package cohttp-async

  1. Overview
  2. Docs

Send an HTTP request with an arbitrary body The request is sent as-is.

val call : ?interrupt:unit Async_kernel.Deferred.t -> ?ssl_config:Conduit_async.V2.Ssl.Config.t -> ?headers:Http.Header.t -> ?chunked:bool -> ?body:Body.t -> Http.Method.t -> Uri.t -> (Http.Response.t * Body.t) Async_kernel.Deferred.t

Send an HTTP request with arbitrary method and a body Infers the transfer encoding. Depending on the given uri, we choose a way to start a communication such as:

  • If the scheme is https, we try to initiate an SSL connection with the given ssl_ctx or a default one on the default port (*:443) or the specified one.
  • If the scheme is httpunix, we use a UNIX domain socket.
  • If the scheme ie http, we try an usual TCP/IP connection on the default port (*:80) or the specified one.
module Connection : sig ... end

Send an HTTP GET request

Send an HTTP HEAD request

val delete : ?interrupt:unit Async_kernel.Deferred.t -> ?ssl_config:Conduit_async.V2.Ssl.Config.t -> ?headers:Http.Header.t -> ?chunked:bool -> ?body:Body.t -> Uri.t -> (Http.Response.t * Body.t) Async_kernel.Deferred.t

Send an HTTP DELETE request

val post : ?interrupt:unit Async_kernel.Deferred.t -> ?ssl_config:Conduit_async.V2.Ssl.Config.t -> ?headers:Http.Header.t -> ?chunked:bool -> ?body:Body.t -> Uri.t -> (Http.Response.t * Body.t) Async_kernel.Deferred.t

Send an HTTP POST request. chunked encoding is off by default as not many servers support it

val put : ?interrupt:unit Async_kernel.Deferred.t -> ?ssl_config:Conduit_async.V2.Ssl.Config.t -> ?headers:Http.Header.t -> ?chunked:bool -> ?body:Body.t -> Uri.t -> (Http.Response.t * Body.t) Async_kernel.Deferred.t

Send an HTTP PUT request. chunked encoding is off by default as not many servers support it

val patch : ?interrupt:unit Async_kernel.Deferred.t -> ?ssl_config:Conduit_async.V2.Ssl.Config.t -> ?headers:Http.Header.t -> ?chunked:bool -> ?body:Body.t -> Uri.t -> (Http.Response.t * Body.t) Async_kernel.Deferred.t

Send an HTTP PATCH request. chunked encoding is off by default as not many servers support it

val post_form : ?interrupt:unit Async_kernel.Deferred.t -> ?ssl_config:Conduit_async.V2.Ssl.Config.t -> ?headers:Http.Header.t -> params:(string * string list) list -> Uri.t -> (Http.Response.t * Body.t) Async_kernel.Deferred.t

Send an HTTP POST request in form format

OCaml

Innovation. Community. Security.