Add OPTIONS method

This commit is contained in:
Stephane Legrand 2023-05-07 15:58:43 +02:00 committed by Simon Cruanes
parent 53032c993e
commit 9c2cf0900d
2 changed files with 4 additions and 0 deletions

View file

@ -64,6 +64,7 @@ module Meth = struct
| `POST
| `HEAD
| `DELETE
| `OPTIONS
]
let to_string = function
@ -72,6 +73,7 @@ module Meth = struct
| `HEAD -> "HEAD"
| `POST -> "POST"
| `DELETE -> "DELETE"
| `OPTIONS -> "OPTIONS"
let pp out s = Format.pp_print_string out (to_string s)
let of_string = function
@ -80,6 +82,7 @@ module Meth = struct
| "POST" -> `POST
| "HEAD" -> `HEAD
| "DELETE" -> `DELETE
| "OPTIONS" -> `OPTIONS
| s -> bad_reqf 400 "unknown method %S" s
end

View file

@ -21,6 +21,7 @@ module Meth : sig
| `POST
| `HEAD
| `DELETE
| `OPTIONS
]
(** A HTTP method.
For now we only handle a subset of these.