complete meth.t
This commit is contained in:
parent
59eb6f3825
commit
ced8cc9ac8
18
src/meth.ml
18
src/meth.ml
@ -1,3 +1,21 @@
|
||||
type t =
|
||||
| Connect
|
||||
| Delete
|
||||
| Get
|
||||
| Head
|
||||
| Options
|
||||
| Post
|
||||
| Put
|
||||
| Trace
|
||||
| Other of string
|
||||
|
||||
let of_httpcats = function
|
||||
| `CONNECT -> Connect
|
||||
| `DELETE -> Delete
|
||||
| `GET -> Get
|
||||
| `HEAD -> Head
|
||||
| `OPTIONS -> Options
|
||||
| `POST -> Post
|
||||
| `PUT -> Put
|
||||
| `TRACE -> Trace
|
||||
| `Other s -> Other s
|
||||
|
||||
12
src/meth.mli
Normal file
12
src/meth.mli
Normal file
@ -0,0 +1,12 @@
|
||||
type t =
|
||||
| Connect
|
||||
| Delete
|
||||
| Get
|
||||
| Head
|
||||
| Options
|
||||
| Post
|
||||
| Put
|
||||
| Trace
|
||||
| Other of string
|
||||
|
||||
val of_httpcats : H2.Method.t -> t
|
||||
@ -60,12 +60,5 @@ let of_httpcats
|
||||
in
|
||||
let route = Uri.path target |> Route.of_string in
|
||||
let headers = H2.Headers.to_list headers in
|
||||
let meth =
|
||||
match meth with
|
||||
| `GET -> Meth.Get
|
||||
| `POST -> Meth.Post
|
||||
| _ ->
|
||||
(* TODO: complete this *)
|
||||
assert false
|
||||
in
|
||||
let meth = Meth.of_httpcats meth in
|
||||
{ route; meth; query; headers }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user