package cohttp-lwt-jsoo

  1. Overview
  2. Docs

Module Cohttp_lwt_xhr.Make_client_asyncSource

Build an asynchronous engine with chunked/unchucked response data treated as raw bytes or UTF

Parameters

module P : Params

Signature

Sourcetype ctx
Sourceval sexp_of_ctx : ctx -> Sexplib0.Sexp.t
Sourceval default_ctx : ctx
Sourceval 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.t

call ?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.

Sourceval head : ?ctx:ctx -> ?headers:Cohttp.Header.t -> Uri.t -> Cohttp.Response.t Lwt.t
Sourceval delete : ?ctx:ctx -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.t
Sourceval post : ?ctx:ctx -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.t
Sourceval put : ?ctx:ctx -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.t
Sourceval patch : ?ctx:ctx -> ?body:Cohttp_lwt.Body.t -> ?chunked:bool -> ?headers:Cohttp.Header.t -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.t
Sourceval post_form : ?ctx:ctx -> ?headers:Cohttp.Header.t -> params:(string * string list) list -> Uri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.t
OCaml

Innovation. Community. Security.