package cohttp

  1. Overview
  2. Docs

Module Cohttp.BodySource

HTTP request and response body handling

Sourcetype t = [
  1. | `Empty
  2. | `String of string
  3. | `Strings of string list
]

Every HTTP body can at least be an empty value or a string

Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
Sourceval __t_of_sexp__ : Sexplib0.Sexp.t -> t

Signature for the core of HTTP body handling. Implementations will extend this signature to add more functions for streaming responses via backend-specific functionality.

include S.Body with type t := t
Sourceval to_string : t -> string
Sourceval to_string_list : t -> string list
Sourceval to_form : t -> (string * string list) list
Sourceval empty : t
Sourceval is_empty : t -> bool
Sourceval of_string : string -> t
Sourceval of_string_list : string list -> t
Sourceval of_form : ?scheme:string -> (string * string list) list -> t
Sourceval map : (string -> string) -> t -> t
Sourceval transfer_encoding : t -> Transfer.encoding
Sourceval length : t -> int64
OCaml

Innovation. Community. Security.