Module Http_types.Headers

type t = (string * string) list

The `t` type, represents a list of HTTP headers as a list of key-value pairs.

include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
val add : key:string -> value:string -> t -> t

add ~key ~value h creates a new list of headers by adding a new header with the given key key and value value to the list of headers h.

val with_host : t -> string -> t

with_host headers host creates a new list of headers by adding a "Host" header with the given value host to the list of headers headers.

val with_content_length : t -> int -> t

with_content_length headers len creates a new list of headers by adding a "Content-Length" header with the given value len to the list of headers headers.

val with_host_of_uri : t -> Uri.t -> t

with_host_of_uri headers url creates a new list of headers by adding a "Host" header with the host and port from the given URL url to the list of headers headers.

val rev : t -> t

rev headers reverses the order of the headers in the given list of headers headers.

val replace : key:string -> value:string -> t -> t