Module Httpaf.Status
Response Status Codes
The status-code element is a three-digit integer code giving the result of the attempt to understand and satisfy the request.
See RFC7231§6 for more details.
type informational=[|`Continue|`Switching_protocols]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=[|`OK|`Created|`Accepted|`Non_authoritative_information|`No_content|`Reset_content|`Partial_content]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=[|`Multiple_choices|`Moved_permanently|`Found|`See_other|`Not_modified|`Use_proxy|`Temporary_redirect]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=[|`Internal_server_error|`Not_implemented|`Bad_gateway|`Service_unavailable|`Gateway_timeout|`Http_version_not_supported]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.
type standard=[|informational|successful|redirection|client_error|server_error]The status codes defined in the HTTP 1.1 RFCs
type t=[|standard|`Code of int]The standard codes along with support for custom codes.
val default_reason_phrase : standard -> stringdefault_reason_phrase standardis the example reason phrase provided by RFC7231 for thestandardstatus code. The RFC allows servers to use reason phrases besides these in responses.
val to_code : t -> intto_code tis the integer representation oft.
val of_code : int -> tof_code iis thetrepresentation ofi.of_coderaisesFailureifiis not a positive three-digit number.
val unsafe_of_code : int -> tunsafe_of_code iis equivalent toof_code i, except it accepts any positive code, regardless of the number of digits it has. On negative codes, it will still raiseFailure.
val is_informational : t -> boolis_informational tis true ifftbelongs to the Informational class of status codes.
val is_successful : t -> boolis_successful tis true ifftbelongs to the Successful class of status codes.
val is_redirection : t -> boolis_redirection tis true ifftbelongs to the Redirection class of status codes.
val is_client_error : t -> boolis_client_error tis true ifftbelongs to the Client Error class of status codes.
val is_server_error : t -> boolis_server_error tis true ifftbelongs to the Server Error class of status codes.
val is_error : t -> boolis_error tis true ifftbelongs to the Client Error or Server Error class of status codes.