package tiny_httpd

  1. Overview
  2. Docs
Minimal HTTP server using threads

Install

dune-project
 Dependency

Authors

Maintainers

Sources

tiny_httpd-0.22.tbz
sha256=09fb93125c26b99f8714d0060dd3fb972046cde3ff935626d495b25e80543d8e
sha512=5751a0ac007c8cad11255d08b4915c8a8fb82ad33d28e58809ef1e29dc8c8f2fceb0dd15ecbe1fda5b5db2edbbc9479fa1d0690a4a25949e1d1b375ea13bd1a9

doc/src/tiny_httpd.core/meth.ml.html

Source file meth.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
open Common_

type t = [ `GET | `PUT | `POST | `HEAD | `DELETE | `OPTIONS | `QUERY ]

let to_string = function
  | `GET -> "GET"
  | `PUT -> "PUT"
  | `HEAD -> "HEAD"
  | `POST -> "POST"
  | `DELETE -> "DELETE"
  | `OPTIONS -> "OPTIONS"
  | `QUERY -> "QUERY"

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

let of_string = function
  | "GET" -> `GET
  | "PUT" -> `PUT
  | "POST" -> `POST
  | "HEAD" -> `HEAD
  | "DELETE" -> `DELETE
  | "OPTIONS" -> `OPTIONS
  | "QUERY" -> `QUERY
  | s -> bad_reqf 400 "unknown method %S" s