Module Cohttp_lwt_s

Portable 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 : Cohttp.S.IO with type 'a t = 'a Lwt.t

The IO module is specialized for the Lwt monad.

module type Net : sig ... end

The Net module type defines how to connect to a remote node and close the resulting channels to clean up.

module type Client : sig ... end

The Client module implements non-pipelined single HTTP client calls. Each call will open a separate Net connection. For best results, the Cohttp_lwt_body that is returned should be consumed in order to close the file descriptor in a timely fashion. It will still be finalized by a GC hook if it is not used up, but this can take some additional time to happen.

module type Server : sig ... end

The Server module implements a pipelined HTTP/1.1 server.