Module Http.Meth

HTTP request methods

Methods

type t = meth

See meth.

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

decode s decodes an HTTP method from s.

val encode : meth -> string

encode m encodes m to an HTTP method.

  • raises Invalid_argument

    if m is `Other t and t is not a Webs.Http.Headers.is_token.

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

pp is an unspecified formatter for methods.

Constraints

type 'a constraint' = meth * 'a

The type for constraining methods to 'a.

val constrain : allowed:'a constraint' list -> meth -> ('a'a constraint' list) Stdlib.result

constrain ~allowed m constrains m to allowed. This is Ok m if m is constrained by allowed and Error allowed otherwise.

val connect : [> `CONNECT ] constraint'

connect adds `CONNECT to the constraint set.

val delete : [> `DELETE ] constraint'

delete adds `DELETE to the constraint set.

val get : [> `GET ] constraint'

get adds `GET to the constraint set.

val head : [> `HEAD ] constraint'

head adds `HEAD to the constraint set.

val options : [> `OPTIONS ] constraint'

options adds `OPTIONS to the constraint set.

val other : string -> 'a -> 'a constraint'

other s v adds a constraint for method s represented by v to the constraint set.

val patch : [> `PATCH ] constraint'

patch adds `PATCH to the constraint set.

val post : [> `POST ] constraint'

post adds `POST to the constraint set.

val put : [> `PUT ] constraint'

put adds `PUT to the constraint set.

val trace : [> `TRACE ] constraint'

trace adds `TRACE to the constraint set.