Module Http.Scheme

HTTP URL schemes.

type t = [
  1. | `Http
  2. | `Https
]

The type for HTTP URL schemes.

val encode : t -> string

encode s encoes s as a lowercase US-ASCII token.

val of_url : string -> t option

of_url u is the scheme of the HTTP URL u or None if u is not an HTTP URL.

val tcp_port : t -> int

tcp_port s is 80 for `Http and 443 for `Https.

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

pp formats schemes for inspection.