Network.HTTP.Types.Status

http-types-0.9: Generic HTTP types for Haskell (for both client and server code).

Safe Haskell | Safe
Language | Haskell98

Network.HTTP.Types.Status

Synopsis

- data Status = Status {
  - statusCode :: Int
  - statusMessage :: ByteString
  }
- mkStatus :: Int -> ByteString -> Status
- status100 :: Status
- continue100 :: Status
- status101 :: Status
- switchingProtocols101 :: Status
- status200 :: Status
- ok200 :: Status
- status201 :: Status
- created201 :: Status
- status202 :: Status
- accepted202 :: Status
- status203 :: Status
- nonAuthoritative203 :: Status
- status204 :: Status
- noContent204 :: Status
- status205 :: Status
- resetContent205 :: Status
- status206 :: Status
- partialContent206 :: Status
- status300 :: Status
- multipleChoices300 :: Status
- status301 :: Status
- movedPermanently301 :: Status
- status302 :: Status
- found302 :: Status
- status303 :: Status
- seeOther303 :: Status
- status304 :: Status
- notModified304 :: Status
- status305 :: Status
- useProxy305 :: Status
- status307 :: Status
- temporaryRedirect307 :: Status
- status308 :: Status
- permanentRedirect308 :: Status
- status400 :: Status
- badRequest400 :: Status
- status401 :: Status
- unauthorized401 :: Status
- status402 :: Status
- paymentRequired402 :: Status
- status403 :: Status
- forbidden403 :: Status
- status404 :: Status
- notFound404 :: Status
- status405 :: Status
- methodNotAllowed405 :: Status
- status406 :: Status
- notAcceptable406 :: Status
- status407 :: Status
- proxyAuthenticationRequired407 :: Status
- status408 :: Status
- requestTimeout408 :: Status
- status409 :: Status
- conflict409 :: Status
- status410 :: Status
- gone410 :: Status
- status411 :: Status
- lengthRequired411 :: Status
- status412 :: Status
- preconditionFailed412 :: Status
- status413 :: Status
- requestEntityTooLarge413 :: Status
- status414 :: Status
- requestURITooLong414 :: Status
- status415 :: Status
- unsupportedMediaType415 :: Status
- status416 :: Status
- requestedRangeNotSatisfiable416 :: Status
- status417 :: Status
- expectationFailed417 :: Status
- status418 :: Status
- imATeaPot418 :: Status
- status428 :: Status
- preconditionRequired428 :: Status
- status429 :: Status
- tooManyRequests429 :: Status
- status431 :: Status
- requestHeaderFieldsTooLarge431 :: Status
- status500 :: Status
- internalServerError500 :: Status
- status501 :: Status
- notImplemented501 :: Status
- status502 :: Status
- badGateway502 :: Status
- status503 :: Status
- serviceUnavailable503 :: Status
- status504 :: Status
- gatewayTimeout504 :: Status
- status505 :: Status
- status511 :: Status
- networkAuthenticationRequired511 :: Status
- httpVersionNotSupported505 :: Status
- statusIsInformational :: Status -> Bool
- statusIsSuccessful :: Status -> Bool
- statusIsRedirection :: Status -> Bool
- statusIsClientError :: Status -> Bool
- statusIsServerError :: Status -> Bool

# Documentation

data Status

HTTP Status.

Only the `statusCode` is used for comparisons.

Please use `mkStatus` to create status codes from code and message, or the `Enum` instance or the status code constants (like `ok200`). There might be additional record members in the future.

Note that the Show instance is only for debugging.

Constructors

Status |
Fields statusCode :: Int statusMessage :: ByteString

Instances

Enum Status |
Eq Status |
Ord Status |
Show Status |

mkStatus :: Int -> ByteString -> Status

Create a Status from status code and message.

status100 :: Status

Continue 100

continue100 :: Status

Continue 100

status101 :: Status

Switching Protocols 101

switchingProtocols101 :: Status

Switching Protocols 101

status200 :: Status

OK 200

ok200 :: Status

OK 200

status201 :: Status

Created 201

created201 :: Status

Created 201

status202 :: Status

Accepted 202

accepted202 :: Status

Accepted 202

status203 :: Status

Non-Authoritative Information 203

nonAuthoritative203 :: Status

Non-Authoritative Information 203

status204 :: Status

No Content 204

noContent204 :: Status

No Content 204

status205 :: Status

Reset Content 205

resetContent205 :: Status

Reset Content 205

status206 :: Status

Partial Content 206

partialContent206 :: Status

Partial Content 206

status300 :: Status

Multiple Choices 300

multipleChoices300 :: Status

Multiple Choices 300

status301 :: Status

Moved Permanently 301

movedPermanently301 :: Status

Moved Permanently 301

status302 :: Status

Found 302

found302 :: Status

Found 302

status303 :: Status

See Other 303

seeOther303 :: Status

See Other 303

status304 :: Status

Not Modified 304

notModified304 :: Status

Not Modified 304

status305 :: Status

Use Proxy 305

useProxy305 :: Status

Use Proxy 305

status307 :: Status

Temporary Redirect 307

temporaryRedirect307 :: Status

Temporary Redirect 307

status308 :: Status

Permanent Redirect 308

permanentRedirect308 :: Status

Permanent Redirect 308

status400 :: Status

Bad Request 400

badRequest400 :: Status

Bad Request 400

status401 :: Status

Unauthorized 401

unauthorized401 :: Status

Unauthorized 401

status402 :: Status

Payment Required 402

paymentRequired402 :: Status

Payment Required 402

status403 :: Status

Forbidden 403

forbidden403 :: Status

Forbidden 403

status404 :: Status

Not Found 404

notFound404 :: Status

Not Found 404

status405 :: Status

Method Not Allowed 405

methodNotAllowed405 :: Status

Method Not Allowed 405

status406 :: Status

Not Acceptable 406

notAcceptable406 :: Status

Not Acceptable 406

status407 :: Status

Proxy Authentication Required 407

proxyAuthenticationRequired407 :: Status

Proxy Authentication Required 407

status408 :: Status

Request Timeout 408

requestTimeout408 :: Status

Request Timeout 408

status409 :: Status

Conflict 409

conflict409 :: Status

Conflict 409

status410 :: Status

Gone 410

gone410 :: Status

Gone 410

status411 :: Status

Length Required 411

lengthRequired411 :: Status

Length Required 411

status412 :: Status

Precondition Failed 412

preconditionFailed412 :: Status

Precondition Failed 412

status413 :: Status

Request Entity Too Large 413

requestEntityTooLarge413 :: Status

Request Entity Too Large 413

status414 :: Status

Request-URI Too Long 414

requestURITooLong414 :: Status

Request-URI Too Long 414

status415 :: Status

Unsupported Media Type 415

unsupportedMediaType415 :: Status

Unsupported Media Type 415

status416 :: Status

Requested Range Not Satisfiable 416

requestedRangeNotSatisfiable416 :: Status

Requested Range Not Satisfiable 416

status417 :: Status

Expectation Failed 417

expectationFailed417 :: Status

Expectation Failed 417

status418 :: Status

I'm a teapot 418

imATeaPot418 :: Status

I'm a teapot 418

status428 :: Status

Precondition Required 428 (RFC 6585)

preconditionRequired428 :: Status

Precondition Required 428 (RFC 6585)

status429 :: Status

Too Many Requests 429 (RFC 6585)

tooManyRequests429 :: Status

Too Many Requests 429 (RFC 6585)

status431 :: Status

Request Header Fields Too Large 431 (RFC 6585)

requestHeaderFieldsTooLarge431 :: Status

Request Header Fields Too Large 431 (RFC 6585)

status500 :: Status

Internal Server Error 500

internalServerError500 :: Status

Internal Server Error 500

status501 :: Status

Not Implemented 501

notImplemented501 :: Status

Not Implemented 501

status502 :: Status

Bad Gateway 502

badGateway502 :: Status

Bad Gateway 502

status503 :: Status

Service Unavailable 503

serviceUnavailable503 :: Status

Service Unavailable 503

status504 :: Status

Gateway Timeout 504

gatewayTimeout504 :: Status

Gateway Timeout 504

status505 :: Status

HTTP Version Not Supported 505

status511 :: Status

Network Authentication Required 511 (RFC 6585)

networkAuthenticationRequired511 :: Status

Network Authentication Required 511 (RFC 6585)

httpVersionNotSupported505 :: Status

HTTP Version Not Supported 505

statusIsInformational :: Status -> Bool

Informational class

statusIsSuccessful :: Status -> Bool

Successful class

statusIsRedirection :: Status -> Bool

Redirection class

statusIsClientError :: Status -> Bool

Client Error class

statusIsServerError :: Status -> Bool

Server Error class