]> gitweb @ CieloNegro.org - Lucu.git/blob - Network/HTTP/Lucu/StatusCode.hs
StatusCode is now a type class, not an algebraic data type.
[Lucu.git] / Network / HTTP / Lucu / StatusCode.hs
1 {-# LANGUAGE
2     DeriveDataTypeable
3   , QuasiQuotes
4   #-}
5 -- |Definition of HTTP status code.
6 -- 'Network.HTTP.Lucu.Resource.setStatus' accepts these named status
7 -- codes so you don't have to memorize that, say, \"Gateway Timeout\"
8 -- is 504.
9 module Network.HTTP.Lucu.StatusCode
10     ( -- * Informational
11       Continue(..)
12     , SwitchingProtocols(..)
13     , Processing(..)
14
15       -- * Successful
16     , OK(..)
17     , Created(..)
18     , Accepted(..)
19     , NonAuthoritativeInformation(..)
20     , NoContent(..)
21     , ResetContent(..)
22     , PartialContent(..)
23     , MultiStatus(..)
24     , AlreadyReported(..)
25     , IMUsed(..)
26
27       -- * Redirection
28     , MultipleChoices(..)
29     , MovedPermanently(..)
30     , Found(..)
31     , SeeOther(..)
32     , NotModified(..)
33     , UseProxy(..)
34     , TemporaryRedirect(..)
35
36       -- * Client Error
37     , BadRequest(..)
38     , Unauthorized(..)
39     , PaymentRequired(..)
40     , Forbidden(..)
41     , NotFound(..)
42     , MethodNotAllowed(..)
43     , NotAcceptable(..)
44     , ProxyAuthenticationRequired(..)
45     , RequestTimeout(..)
46     , Conflict(..)
47     , Gone(..)
48     , LengthRequired(..)
49     , PreconditionFailed(..)
50     , RequestEntityTooLarge(..)
51     , RequestURITooLarge(..)
52     , UnsupportedMediaType(..)
53     , RequestRangeNotSatisfiable(..)
54     , ExpectationFailed(..)
55     , UnprocessableEntity(..)
56     , Locked(..)
57     , FailedDependency(..)
58     , UpgradeRequired(..)
59
60       -- * Server Error
61     , InternalServerError(..)
62     , NotImplemented(..)
63     , BadGateway(..)
64     , ServiceUnavailable(..)
65     , GatewayTimeout(..)
66     , HTTPVersionNotSupported(..)
67     , VariantAlsoNegotiates(..)
68     , InsufficientStorage(..)
69     , LoopDetected(..)
70     , NotExtended(..)
71     )
72     where
73 import Data.Typeable
74 import Network.HTTP.Lucu.StatusCode.Internal
75
76 [statusCodes|
77 100 Continue
78 101 Switching Protocols
79 102 Processing
80
81 200 OK
82 201 Created
83 202 Accepted
84 203 Non Authoritative Information
85 204 No Content
86 205 Reset Content
87 206 Partial Content
88 207 Multi Status
89 208 Already Reported
90 226 IM Used
91
92 300 Multiple Choices
93 301 Moved Permanently
94 302 Found
95 303 See Other
96 304 Not Modified
97 305 Use Proxy
98 307 Temporary Redirect
99
100 400 Bad Request
101 401 Unauthorized
102 402 Payment Required
103 403 Forbidden
104 404 Not Found
105 405 Method Not Allowed
106 406 Not Acceptable
107 407 Proxy Authentication Required
108 408 Request Timeout
109 409 Conflict
110 410 Gone
111 411 Length Required
112 412 Precondition Failed
113 413 Request Entity Too Large
114 414 Request URI Too Large
115 415 Unsupported Media Type
116 416 Request Range Not Satisfiable
117 417 Expectation Failed
118 422 Unprocessable Entity
119 423 Locked
120 424 Failed Dependency
121 426 Upgrade Required
122
123 500 Internal Server Error
124 501 Not Implemented
125 502 Bad Gateway
126 503 Service Unavailable
127 504 Gateway Timeout
128 505 HTTP Version Not Supported
129 506 Variant Also Negotiates
130 507 Insufficient Storage
131 508 Loop Detected
132 510 Not Extended
133 |]