Module Cohttp_server_lwt_unix.Body

module Encoding : sig ... end
type t

A response body

val string : ?encoding:Encoding.t -> string -> t

string ?encoding s respond with body s.

?encoding the encoding to use. by default this is Encoding.fixed

module Substring : sig ... end
val stream : ?encoding:Encoding.t -> (unit -> Substring.t option Lwt.t) -> t

stream ?encoding f respond with body generated by repeatedly applying f. When f returns None, it will be considered terminated.

?encoding is the encoding to use. By default this is Encoding.chunked.