Module Http.Version

Versions.

type t = int * int

The type for HTTP versions. Both integers must be in the interval [0;9].

val v11 : t

v11 is (1, 1).

val v20 : t

v20 is (2, 0).

val v30 : t

v30 is (3, 0).

Converting

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

decode s decodes a version from s. Single digit versions are also parsed, some serializations (e.g. the curl tool) do that.

val encode : t -> string

encode v encodes the version v. Assumes correct integer ranges.

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

pp formats versions for inspection.