mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
Add OPTIONS method
This commit is contained in:
parent
53032c993e
commit
9c2cf0900d
2 changed files with 4 additions and 0 deletions
|
|
@ -64,6 +64,7 @@ module Meth = struct
|
||||||
| `POST
|
| `POST
|
||||||
| `HEAD
|
| `HEAD
|
||||||
| `DELETE
|
| `DELETE
|
||||||
|
| `OPTIONS
|
||||||
]
|
]
|
||||||
|
|
||||||
let to_string = function
|
let to_string = function
|
||||||
|
|
@ -72,6 +73,7 @@ module Meth = struct
|
||||||
| `HEAD -> "HEAD"
|
| `HEAD -> "HEAD"
|
||||||
| `POST -> "POST"
|
| `POST -> "POST"
|
||||||
| `DELETE -> "DELETE"
|
| `DELETE -> "DELETE"
|
||||||
|
| `OPTIONS -> "OPTIONS"
|
||||||
let pp out s = Format.pp_print_string out (to_string s)
|
let pp out s = Format.pp_print_string out (to_string s)
|
||||||
|
|
||||||
let of_string = function
|
let of_string = function
|
||||||
|
|
@ -80,6 +82,7 @@ module Meth = struct
|
||||||
| "POST" -> `POST
|
| "POST" -> `POST
|
||||||
| "HEAD" -> `HEAD
|
| "HEAD" -> `HEAD
|
||||||
| "DELETE" -> `DELETE
|
| "DELETE" -> `DELETE
|
||||||
|
| "OPTIONS" -> `OPTIONS
|
||||||
| s -> bad_reqf 400 "unknown method %S" s
|
| s -> bad_reqf 400 "unknown method %S" s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ module Meth : sig
|
||||||
| `POST
|
| `POST
|
||||||
| `HEAD
|
| `HEAD
|
||||||
| `DELETE
|
| `DELETE
|
||||||
|
| `OPTIONS
|
||||||
]
|
]
|
||||||
(** A HTTP method.
|
(** A HTTP method.
|
||||||
For now we only handle a subset of these.
|
For now we only handle a subset of these.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue