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. | `Accepted
  4. | `No_content
  5. | `Found
  6. | `Moved
  7. | `Bad_request
  8. | `Unauthorized
  9. | `Payment_required
  10. | `Forbidden
  11. | `Not_found
  12. | `Method_not_allowed
  13. | `Not_acceptable
  14. | `Conflict
  15. | `Length_required
  16. | `Request_too_large
  17. | `I'm_a_teapot
  18. | `Unprocessable_content
  19. | `Too_many_requests
  20. | `Internal_server_error
  21. | `Not_implemented
  22. | `Service_unavailable
  23. | `Version_not_supported
  24. | `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 : ?via:Unix.inet_addr list -> 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.