package tiny_httpd

  1. Overview
  2. Docs
Minimal HTTP server using threads

Install

Dune Dependency

Authors

Maintainers

Sources

tiny_httpd-0.17.0.tbz
sha256=67c636f1bbaf93da0cb0a12cb44803299892caf51e637815c753f0af6f4e7b7e
sha512=c254415a69df5a1bec255a223dbc2d10370b2f533da0b14ff458545da7aa5e4a634972272e7eef64425b6360494d6b3446761c03b49fd7558765cbfefae2178b

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

Source file response_code.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
25
26
27
28
29
30
31
32
type t = int

let ok = 200
let not_found = 404

let descr = function
  | 100 -> "Continue"
  | 200 -> "OK"
  | 201 -> "Created"
  | 202 -> "Accepted"
  | 204 -> "No content"
  | 300 -> "Multiple choices"
  | 301 -> "Moved permanently"
  | 302 -> "Found"
  | 304 -> "Not Modified"
  | 400 -> "Bad request"
  | 401 -> "Unauthorized"
  | 403 -> "Forbidden"
  | 404 -> "Not found"
  | 405 -> "Method not allowed"
  | 408 -> "Request timeout"
  | 409 -> "Conflict"
  | 410 -> "Gone"
  | 411 -> "Length required"
  | 413 -> "Payload too large"
  | 417 -> "Expectation failed"
  | 500 -> "Internal server error"
  | 501 -> "Not implemented"
  | 503 -> "Service unavailable"
  | n -> "Unknown response code " ^ string_of_int n (* TODO *)

let[@inline] is_success n = n < 400
OCaml

Innovation. Community. Security.