package dream
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=bf19c13f0da7e01cc30b8dfaa1fca1dc8b44a06fb6e0eef56d56513952b9bb01
md5=1220f17530522e488653eb91115867e3
doc/dream.h2/H2/Status/index.html
Module H2.Status
Source
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.
This module is a strict superset of Httpaf.Status
. Even though the HTTP/2 specification removes support for the Switching_protocols
status code, h2 keeps it for the sake of higher level interaction between OCaml libraries that support both HTTP/1 and HTTP/2.
See RFC7540§8.1.1 for more details.
include module type of Httpaf.Status
with type client_error := Httpaf.Status.client_error
and type standard := Httpaf.Status.standard
and type t := Httpaf.Status.t
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.
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 server_error = [
| `Internal_server_error
| `Not_implemented
| `Bad_gateway
| `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.
The 4xx (Client Error) class of status code indicates that the client seems to have erred.
See RFC7231§6.5 for more details.
In addition to http/af, this type also includes the 421 (Misdirected Request) tag. See RFC7540§9.1.2 for more details.
The status codes defined in the HTTP/1.1 RFCs, excluding the Switching Protocols
status and including the Misdirected Request
as per the HTTP/2 RFC.
See RFC7540§8.1.1 and RFC7540§9.1.2 for more details.
default_reason_phrase standard
is the example reason phrase provided by RFC7231 for the standard
status code. The RFC allows servers to use reason phrases besides these in responses.
of_code i
is the t
representation of i
. of_code
raises Failure
if i
is not a positive three-digit number.
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 Failure
.
is_informational t
is true
iff t
belongs to the Informational class of status codes.
is_successful t
is true
iff t
belongs to the Successful class of status codes.
is_redirection t
is true
iff t
belongs to the Redirection class of status codes.
is_client_error t
is true
iff t
belongs to the Client Error class of status codes.
is_server_error t
is true
iff t
belongs to the Server Error class of status codes.
is_server_error t
is true
iff t
belongs to the Client Error or Server Error class of status codes.