Webs.Http_clientHTTP clients.
See the quick start and the cookbock.
default_max_redirection is 10, the default maximal number of redirections when they are followed, see request.
val id : t -> stringid httpc identifies the underlying implementation of httpc.
val request :
?max_redirections:int ->
t ->
follow:bool ->
Http.Request.t ->
(Http.Response.t, string) Stdlib.resultrequest httpc ~follow request performs request request via httpc. To construct a request from an URL use Http.Request.of_url. Read more details about how request is interpreted by client connectors in the client connector conventions.
If follow is true and the request is GET or HEAD, HTTP responses are automatically redirected on 301, 302, 303, 305, 307 and 308. In this case the the original request is modified as follows:
Http.Headers.referer, Http.Headers.origin, Http.Headers.connection and the conditional request headers Http.Headers.if_match Http.Headers.if_none_match, Http.Headers.if_modified_since Http.Headers.if_unmodified_since, Http.Headers.if_range are droppedHttp.Headers.authorization, Http.Headers.proxy_authorization and Http.Headers.cookie are droppedThe maximal number of redirection is given by max_redirection and defaults to default_max_redirection.
If, and only if, there was a follow, the final requested URL can be found in the response in the x_follow_location header.
val x_follow_location : Http.Headers.Name.tx_follow_location is the final location that was requested on ~follow:true. Only added if there was a redirection.
If you devise your own HTTP client it should provide constructor functions that return Http_client.t values directly. These values are constructed with make.
module type T = sig ... endClient connector.