package opium

  1. Overview
  2. Docs

Protocol Version

HTTP uses a "<major>.<minor>" numbering scheme to indicate versions of the protocol. The protocol version as a whole indicates the sender's conformance with the set of requirements laid out in that version's corresponding specification of HTTP.

See RFC7230§2.6 for more details.

type t = Httpaf.Version.t = {
  1. major : int;
  2. minor : int;
}
val compare : t -> t -> int

compare x y returns 0 if version x is equal to version y, a negative integer if version x is less than version y, and a positive integer if version x is greater than version y.

val to_string : t -> string

to_string t returns a string representation of the version t.

val of_string : string -> t

of_string s returns a version from its string representation s.

Utilities

val sexp_of_t : t -> Sexplib0.Sexp.t

sexp_of_t t converts the request t to an s-expression

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

pp formats the request t as an s-expression

val pp_hum : Format.formatter -> t -> unit

pp_hum formats the request t as a standard HTTP request

OCaml

Innovation. Community. Security.