Skip to content

Commit

Permalink
added doc for make-https-requester
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrenN committed Aug 26, 2016
1 parent 023da94 commit 8c3b163
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions request/private/http-location.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ relative paths as locations.
@racket[domain] to construct a full http @racket[url],
which is then passed to the underlying @racket[requester].
The relative path should not begin with a slash.
@racketinput[
@racketblock[
(define foo-com-requester
(make-domain-requester "foo.com" http-requester))
(get foo-com-requester "some/sort/of/path") ;; request to http://foo.com/some/sort/of/path
(code:comment @#,elem{request to http://foo.com/some/sort/of/path})
(get foo-com-requester "some/sort/of/path")
]}

@defproc[(make-host+port-requester [host string?]
Expand All @@ -39,3 +40,15 @@ relative paths as locations.
@racket[(make-host+port-requester "foo.com" 8080 some-requester)]
is equivalent to @racket[(make-domain-requester "foo.com:8080" some-requester)]
}

@defproc[(make-https-requester [requester requester?])
requester?]{
Given a requester that accepts @racket[url?]s
as locations, returns a requester that accepts a @racket[url] and converts
it to use an https scheme before being passed to the underlying @racket[requester].
@racketblock[
(define foo-https-requester
(make-domain-requester "foo.com" (make-https-requester http-requester)))
(code:comment @#,elem{request to https://foo.com/some/sort/of/path})
(get foo-https-requester "some/sort/of/path")
]}

0 comments on commit 8c3b163

Please sign in to comment.