The 1xx (Informational) class of status code indicates an interim response for communicating connection status or request progress prior to completing the requested action and sending a final response. See RFC7231§6.2 for more details.
type successful = [
The 2xx (Successful) class of status code indicates that the client's request was successfully received, understood, and accepted. See RFC7231§6.3 for more details.
type redirection = [
The 3xx (Redirection) class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. See RFC7231§6.4 for more details.
type client_error = [
The 4xx (Client Error) class of status code indicates that the client seems to have erred. See RFC7231§6.5 for more details.
type server_error = [
The 5xx (Server Error) class of status code indicates that the server is aware that it has erred or is incapable of performing the requested method. See RFC7231§6.6 for more details.
The status codes defined in the HTTP 1.1 RFCs
type t = [
The standard codes along with support for custom codes.
val default_reason_phrase : t -> string
default_reason_phrase standard is the example reason phrase provided by RFC7231 for the
t status code. The RFC allows servers to use reason phrases besides these in responses.
val long_reason_phrase : t -> string
long_reason_phrase standard is an explanation of the the
t status code.
val to_code : t -> int
to_code t is the integer representation of
val of_code : int -> t
of_code i is the
t representation of
i is not a positive three-digit number.
val unsafe_of_code : int -> t
unsafe_of_code i is equivalent to
of_code i, except it accepts any positive code, regardless of the number of digits it has. On negative codes, it will still raise
val is_informational : t -> bool
is_informational t is true iff
t belongs to the Informational class of status codes.
val is_successful : t -> bool
is_successful t is true iff
t belongs to the Successful class of status codes.
val is_redirection : t -> bool
is_redirection t is true iff
t belongs to the Redirection class of status codes.
val is_client_error : t -> bool
is_client_error t is true iff
t belongs to the Client Error class of status codes.
val is_server_error : t -> bool
is_server_error t is true iff
t belongs to the Server Error class of status codes.
val is_error : t -> bool
is_error t is true iff
t belongs to the Client Error or Server Error class of status codes.
val to_string : t -> string
to_string t returns a string representation of the status
val of_string : string -> t
of_string s returns a status from its string representation