Module B0_http.Http_client

HTTP clients.

type t

The type for HTTP clients.

val get : ?search:B0_std.Fpath.t list -> ?curl:B0_std.Cmd.t -> unit -> (t, string) Stdlib.result

get () looks for curl (defaults to "curl") in search.

val fetch : ?insecure:bool -> ?follow:bool -> t -> Http.Request.t -> (Http.Response.t, string) Stdlib.result

fetch httpr r performs request r via httpr. If follow is true (default) HTTP redirects for GET and HEAD requests that return 301, 302, 303, 305 or 307 are automatically followed. If insecure is true (defaults to false) TLS server certificates are not checked.

The response's Http.Response.headers are lowercased.

Command line interface

val curl : ?docs:string -> ? -> unit -> B0_std.Cmd.t Cmdliner.Term.t

curl is a cli interface for specifying the curl command line tool.