Up

module Code

: sig
#
type version = [
| `HTTP_1_0
| `HTTP_1_1
| `Other of string
]
#
type meth = [
| `GET
| `POST
| `HEAD
| `DELETE
| `PATCH
| `PUT
| `OPTIONS
| `Other of string
]
#
type informational_status = [
| `Continue
| `Switching_protocols
| `Processing
| `Checkpoint
]

Informational

#
type success_status = [
| `OK
| `Created
| `Accepted
| `Non_authoritative_information
| `No_content
| `Reset_content
| `Partial_content
| `Multi_status
| `Already_reported
| `Im_used
]

Success

#
type redirection_status = [
| `Multiple_choices
| `Moved_permanently
| `Found
| `See_other
| `Not_modified
| `Use_proxy
| `Switch_proxy
| `Temporary_redirect
| `Resume_incomplete
]

Redirection

#
type client_error_status = [
| `Bad_request
| `Unauthorized
| `Payment_required
| `Forbidden
| `Not_found
| `Method_not_allowed
| `Not_acceptable
| `Proxy_authentication_required
| `Request_timeout
| `Conflict
| `Gone
| `Length_required
| `Precondition_failed
| `Request_entity_too_large
| `Request_uri_too_long
| `Unsupported_media_type
| `Requested_range_not_satisfiable
| `Expectation_failed
| `I_m_a_teapot
| `Enhance_your_calm
| `Unprocessable_entity
| `Locked
| `Failed_dependency
| `Upgrade_required
| `Precondition_required
| `Too_many_requests
| `Request_header_fields_too_large
| `No_response
| `Retry_with
| `Blocked_by_windows_parental_controls
| `Wrong_exchange_server
| `Client_closed_request
]

Client_error

#
type server_error_status = [
| `Internal_server_error
| `Not_implemented
| `Bad_gateway
| `Service_unavailable
| `Gateway_timeout
| `Http_version_not_supported
| `Variant_also_negotiates
| `Insufficient_storage
| `Loop_detected
| `Bandwidth_limit_exceeded
| `Not_extended
| `Network_authentication_required
| `Network_read_timeout_error
| `Network_connect_timeout_error
]

Server_error

#
type status_code = [
| `Code of int
]
#
val string_of_version : version -> string

Convert a version to a string.

#
val version_of_string : string -> version

Convert a string to a version.

#
val compare_version : version -> version -> int

Comparison function for version values

#
val string_of_method : meth -> string

Convert a method to a string.

#
val method_of_string : string -> meth

Convert a string to a method.

#
val compare_method : meth -> meth -> int

Comparison function for method values

#
val status_of_code : int -> status_code

Generate status values from int codes.

#
val code_of_status : status_code -> int

Generate an int code from a status value.

#
val string_of_status : status_code -> string

Give a description of the given status value.

#
val reason_phrase_of_code : int -> string

Give a description of the given int code.

#
val is_informational : int -> bool

Is the given int code belong to the class of "informational" return code ?

#
val is_success : int -> bool

Is the given int code belong to the class of "success" return code ?

#
val is_redirection : int -> bool

Is the given int code belong to the class of "redirection" return code ?

#
val is_client_error : int -> bool

Is the given int code belong to the class of "client_error" return code ?

#
val is_server_error : int -> bool

Is the given int code belong to the class of "server_error" return code ?

#
val is_error : int -> bool

Return true for client and server error status codes.

#
val version_of_sexp : Sexplib.Sexp.t -> version
#
val __version_of_sexp__ : Sexplib.Sexp.t -> version
#
val sexp_of_version : version -> Sexplib.Sexp.t
#
val meth_of_sexp : Sexplib.Sexp.t -> meth
#
val __meth_of_sexp__ : Sexplib.Sexp.t -> meth
#
val sexp_of_meth : meth -> Sexplib.Sexp.t
#
val informational_status_of_sexp : Sexplib.Sexp.t -> informational_status
#
val __informational_status_of_sexp__ : Sexplib.Sexp.t -> informational_status
#
val sexp_of_informational_status : informational_status -> Sexplib.Sexp.t
#
val success_status_of_sexp : Sexplib.Sexp.t -> success_status
#
val __success_status_of_sexp__ : Sexplib.Sexp.t -> success_status
#
val sexp_of_success_status : success_status -> Sexplib.Sexp.t
#
val redirection_status_of_sexp : Sexplib.Sexp.t -> redirection_status
#
val __redirection_status_of_sexp__ : Sexplib.Sexp.t -> redirection_status
#
val sexp_of_redirection_status : redirection_status -> Sexplib.Sexp.t
#
val client_error_status_of_sexp : Sexplib.Sexp.t -> client_error_status
#
val __client_error_status_of_sexp__ : Sexplib.Sexp.t -> client_error_status
#
val sexp_of_client_error_status : client_error_status -> Sexplib.Sexp.t
#
val server_error_status_of_sexp : Sexplib.Sexp.t -> server_error_status
#
val __server_error_status_of_sexp__ : Sexplib.Sexp.t -> server_error_status
#
val sexp_of_server_error_status : server_error_status -> Sexplib.Sexp.t
#
val status_of_sexp : Sexplib.Sexp.t -> status
#
val __status_of_sexp__ : Sexplib.Sexp.t -> status
#
val sexp_of_status : status -> Sexplib.Sexp.t
#
val status_code_of_sexp : Sexplib.Sexp.t -> status_code
#
val __status_code_of_sexp__ : Sexplib.Sexp.t -> status_code
#
val sexp_of_status_code : status_code -> Sexplib.Sexp.t
end