include Cohttp_lwt.S.Client with type ctx = Net.ctx
type ctx = Net.ctxval sexp_of_ctx : ctx -> Ppx_sexp_conv_lib.Sexp.tval default_ctx : ctxval call : ?ctx:ctx -> ?headers:Cohttp.Header.t -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> Cohttp.Code.meth -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.tcall ?ctx ?headers ?body ?chunked meth uri will resolve the uri to a concrete network endpoint using the resolver initialized in ctx. It will then issue an HTTP request with method meth, adding request headers from headers if present. If a body is specified then that will be included with the request, using chunked encoding if chunked is true. The default is to disable chunked encoding for HTTP request bodies for compatibility reasons.
In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.
val head : ?ctx:ctx -> ?headers:Cohttp.Header.t -> Uri.t -> Cohttp.Response.t Lwt.tval get : ?ctx:ctx -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.tval delete : ?ctx:ctx -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.tval post : ?ctx:ctx -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.tval put : ?ctx:ctx -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.tval patch : ?ctx:ctx -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.tval post_form : ?ctx:ctx -> ?headers:Cohttp.Header.t -> params:(string * string list) list -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.tval callv : ?ctx:ctx -> Uri.t -> (Cohttp.Request.t * Cohttp_lwt.Body.t) Lwt_stream.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.tval custom_ctx : ?ctx:Conduit_lwt_unix.ctx -> ?resolver:Resolver_lwt.t -> unit -> ctxcustom_ctx ?ctx ?resolver () will return a context that is the same as the default_ctx, but with either the connection handling or resolution module overridden with ctx or resolver respectively.
This is useful to supply a Conduit_lwt_unix.ctx with a custom source network interface, or a Resolver_lwt.t with a different name resolution strategy (for instance to override a hostname to point it to a Unix domain socket).