Module ReWeb.Client

Make web requests.

The request functions below return a response of type ([> Response.http], string) Lwt_result.t. This is a promise containing a result of either Ok response where response is an HTTP response, or a string containing an error message.

type config = Piaf.Config.t = {
follow_redirects : bool;
max_redirects : int;
allow_insecure : bool;
max_http_version : Piaf.Versions.HTTP.t;
h2c_upgrade : bool;
http2_prior_knowledge : bool;
cacert : string option;
capath : string option;
min_tls_version : Piaf.Versions.TLS.t;
max_tls_version : Piaf.Versions.TLS.t;
tcp_nodelay : bool;
connect_timeout : float;
buffer_size : int;
body_buffer_size : int;
enable_http2_server_push : bool;
}

See the Piaf module documentation for more information on these options.

type headers = (string * string) list
val config : config

Use this config value to override the default config in client requests.

module New : sig ... end

Make requests with a one-shot i.e. stateless client.