Skip to content

Commit f8a353f

Browse files
committed
add `QUERY method
1 parent 699e9aa commit f8a353f

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/core/meth.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
open Common_
22

3-
type t = [ `GET | `PUT | `POST | `HEAD | `DELETE | `OPTIONS ]
3+
type t = [ `GET | `PUT | `POST | `HEAD | `DELETE | `OPTIONS | `QUERY ]
44

55
let to_string = function
66
| `GET -> "GET"
@@ -9,6 +9,7 @@ let to_string = function
99
| `POST -> "POST"
1010
| `DELETE -> "DELETE"
1111
| `OPTIONS -> "OPTIONS"
12+
| `QUERY -> "QUERY"
1213

1314
let pp out s = Format.pp_print_string out (to_string s)
1415

@@ -19,4 +20,5 @@ let of_string = function
1920
| "HEAD" -> `HEAD
2021
| "DELETE" -> `DELETE
2122
| "OPTIONS" -> `OPTIONS
23+
| "QUERY" -> `QUERY
2224
| s -> bad_reqf 400 "unknown method %S" s

src/core/meth.mli

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
(** HTTP Methods *)
22

3-
type t = [ `GET | `PUT | `POST | `HEAD | `DELETE | `OPTIONS ]
3+
type t = [ `GET | `PUT | `POST | `HEAD | `DELETE | `OPTIONS | `QUERY ]
44
(** A HTTP method. For now we only handle a subset of these.
55
6-
See https://tools.ietf.org/html/rfc7231#section-4 *)
6+
See https://tools.ietf.org/html/rfc7231#section-4
7+
8+
[`QUERY] added @since NEXT_RELEASE , see https://www.rfc-editor.org/info/rfc10008/
9+
and https://blainsmith.com/articles/rfc-10008-http-query-method/
10+
*)
711

812
val pp : Format.formatter -> t -> unit
913
val to_string : t -> string

0 commit comments

Comments
 (0)