Module Headers.Name

Header names.

See also standard header names.

HTTP header names are US-ASCII case insensitive. Values of type Name.t represent US-ASCII lowercased HTTP tokens.

type t = private string

The type for lowercased HTTP header field field-names.

val make : string -> t

make s is a name from s. Raises Invalid_argument if s is not a header name. Use decode if you need to handle failures.

Converting

val decode : string -> (t, string) Stdlib.result

decode s decodes HTTP field-name from s.

val encode : t -> string

encode n encodes n to an HTTP field-name.

Predicates and comparisons

val equal : t -> t -> bool

equal tests names for equality.

val compare : t -> t -> int

compare is a total order on names compatible with equal.

Formatting

val pp : Stdlib.Format.formatter -> t -> unit

pp formats header names for inspection.