Tiny_httpd_core.Headers
Headers
Headers are metadata associated with a request or response.
The header files of a request or response.
Neither the key nor the value can contain '\r'
or '\n'
. See https://tools.ietf.org/html/rfc7230#section-3.2
val empty : t
Empty list of headers.
val get : ?f:(string -> string) -> string -> t -> string option
get k headers
looks for the header field with key k
.
val get_exn : ?f:(string -> string) -> string -> t -> string
set k v headers
sets the key k
to value v
. It erases any previous entry for k
val contains : string -> t -> bool
Is there a header with the given key?
val pp : Stdlib.Format.formatter -> t -> unit
Pretty print the headers.
val parse_ : buf:Buf.t -> IO.Input.t -> t