Http.Method
Methods and method constraints.
The type for request methods.
val decode : string -> (t, string) Stdlib.result
decode s
decodes a method from s
.
val encode : t -> string
encode m
encodes m
to a method.
val pp : Stdlib.Format.formatter -> t -> unit
pp
formats methods for inspection.
type 'a constraint' = t * 'a
The type for constraining methods to 'a
.
val constrain :
allowed:'a constraint' list ->
t ->
('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.