Cohttp_lwt.SPortable Lwt implementation of HTTP client and server, without depending on a particular I/O implementation. The various Make functors must be instantiated by an implementation that provides a concrete IO monad.
module type IO = sig ... endThe IO module is specialized for the Lwt monad.
module type Net = sig ... endThe Net module type defines how to connect to a remote node and close the resulting channels to clean up.
module type Sleep = sig ... endThis is compatible with Mirage_time.S. It may be satisfied by mirage-time-unix Time or Mirage_time.
type call =
?headers:Http.Header.t ->
?body:Body.t ->
?absolute_form:bool ->
Http.Method.t ->
Uri.t ->
(Cohttp.Response.t * Body.t) Lwt.tcall ?headers ?body method uri Function type used to handle http requests
Leaks are detected by the GC and logged as debug messages, these can be enabled activating the debug logging. For example, this can be done as follows in cohttp-lwt-unix
Cohttp_lwt_unix.Debug.activate_debug ();
Logs.set_level (Some Logs.Warning)module type Connection = sig ... endThe Connection module handles a single, possibly pipelined, http connection.
module type Connection_cache = sig ... endA Connection_cache handles http requests. It not necessarily caches connections.
module type Client = sig ... endThe Client module is a collection of convenience functions for constructing and processing requests.
module type Server = sig ... endThe Server module implements a pipelined HTTP/1.1 server.