Module Http.Scheme

HTTP URL schemes.

Schemes

type t =
  1. | Http
  2. | Https

The type for HTTP URL schemes.

val tcp_port : t -> int

tcp_port s is 80 for Http and 443 for Https.

Converting

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

decode_of_url url decodes an HTTP URL scheme from url.

val encode : t -> string

encode s encodes s to the corresponding URL scheme.

Predicates and comparisons

val equal : t -> t -> bool

equal tests schemes for equality.

val compare : t -> t -> int

compare is a total order on schemes compatible with equal.

Formatting

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

pp formats schemes for inspection.