An OCaml webserver, but the allocating version (vs httpz which doesnt)
at main 26 lines 407 B view raw
1(* method.ml - HTTP methods *) 2 3type t = 4 | Get 5 | Head 6 | Post 7 | Put 8 | Delete 9 | Connect 10 | Options 11 | Trace 12 | Patch 13 14let to_string = function 15 | Get -> "GET" 16 | Head -> "HEAD" 17 | Post -> "POST" 18 | Put -> "PUT" 19 | Delete -> "DELETE" 20 | Connect -> "CONNECT" 21 | Options -> "OPTIONS" 22 | Trace -> "TRACE" 23 | Patch -> "PATCH" 24;; 25 26let pp fmt t = Stdlib.Format.fprintf fmt "%s" (to_string t)