Definition of things related on HTTP response.
- data StatusCode
- = Continue
- | SwitchingProtocols
- | Processing
- | Ok
- | Created
- | Accepted
- | NonAuthoritativeInformation
- | NoContent
- | ResetContent
- | PartialContent
- | MultiStatus
- | MultipleChoices
- | MovedPermanently
- | Found
- | SeeOther
- | NotModified
- | UseProxy
- | TemporaryRedirect
- | BadRequest
- | Unauthorized
- | PaymentRequired
- | Forbidden
- | NotFound
- | MethodNotAllowed
- | NotAcceptable
- | ProxyAuthenticationRequired
- | RequestTimeout
- | Conflict
- | Gone
- | LengthRequired
- | PreconditionFailed
- | RequestEntityTooLarge
- | RequestURITooLarge
- | UnsupportedMediaType
- | RequestRangeNotSatisfiable
- | ExpectationFailed
- | UnprocessableEntitiy
- | Locked
- | FailedDependency
- | InternalServerError
- | NotImplemented
- | BadGateway
- | ServiceUnavailable
- | GatewayTimeout
- | HttpVersionNotSupported
- | InsufficientStorage
- data Response = Response {
- resVersion :: !HttpVersion
- resStatus :: !StatusCode
- resHeaders :: !Headers
- hPutResponse :: Handle -> Response -> IO ()
- isInformational :: StatusCode -> Bool
- isSuccessful :: StatusCode -> Bool
- isRedirection :: StatusCode -> Bool
- isError :: StatusCode -> Bool
- isClientError :: StatusCode -> Bool
- isServerError :: StatusCode -> Bool
- statusCode :: StatusCode -> (#Int, ByteString#)
Documentation
data StatusCode Source
This is the definition of HTTP status code.
Network.HTTP.Lucu.Resource.setStatus
accepts these named statuses
so you don't have to memorize, for instance, that "Gateway
Timeout" is 504.
Response | |
|
isInformational :: StatusCode -> BoolSource
is isInformational
scTrue
iff sc < 200
.
isSuccessful :: StatusCode -> BoolSource
is isSuccessful
scTrue
iff 200 <= sc < 300
.
isRedirection :: StatusCode -> BoolSource
is isRedirection
scTrue
iff 300 <= sc < 400
.
isClientError :: StatusCode -> BoolSource
is isClientError
scTrue
iff 400 <= sc < 500
.
isServerError :: StatusCode -> BoolSource
is isServerError
scTrue
iff 500 <= sc
.
statusCode :: StatusCode -> (#Int, ByteString#)Source
returns an unboxed tuple of numeric and textual
representation of statusCode
scsc
.