package devkit

  1. Overview
  2. Docs
type encoding =
  1. | Gzip
  2. | Identity
type meth = [
  1. | `GET
  2. | `POST
  3. | `PUT
  4. | `PATCH
  5. | `DELETE
  6. | `HEAD
  7. | `OPTIONS
]
type request = {
  1. addr : Unix.sockaddr;
  2. url : string;
  3. path : string;
  4. args : (string * string) list;
  5. conn : Time.t;
  6. recv : Time.t;
  7. meth : meth;
  8. headers : (string * string) list;
  9. body : string;
  10. version : int * int;
  11. id : int;
  12. socket : Unix.file_descr;
  13. line : string;
    (*

    request line

    *)
  14. mutable blocking : unit IO.output option;
  15. encoding : encoding;
}
type reply_status = [
  1. | `Ok
  2. | `Created
  3. | `No_content
  4. | `Found
  5. | `Moved
  6. | `Bad_request
  7. | `Unauthorized
  8. | `Payment_required
  9. | `Forbidden
  10. | `Not_found
  11. | `Method_not_allowed
  12. | `Not_acceptable
  13. | `Conflict
  14. | `Length_required
  15. | `Request_too_large
  16. | `I'm_a_teapot
  17. | `Internal_server_error
  18. | `Not_implemented
  19. | `Service_unavailable
  20. | `Version_not_supported
  21. | `Custom of string
]
type extended_reply_status = [
  1. | reply_status
  2. | `No_reply
]
type 'status reply' = 'status * (string * string) list * string
val show_method : [< `DELETE | `GET | `HEAD | `OPTIONS | `PATCH | `POST | `PUT ] -> string
val method_of_string : string -> [> `DELETE | `GET | `HEAD | `OPTIONS | `PATCH | `POST | `PUT ]
val show_client_addr : request -> string
val client_addr : request -> Unix.inet_addr * int
val client_ip : request -> Unix.inet_addr
val find_header : request -> string -> string
val header_exn : request -> string -> string
val header_safe : request -> string -> string
val header_referer : request -> string
val show_request : request -> string
val status_code : reply_status -> int
val show_http_reply : reply_status -> string
val cors_preflight_allow_all : [> `No_content ] * (string * string) list * string
OCaml

Innovation. Community. Security.