http_status_codes2/
status_code_registry.rs

1//! Representation of the Hypertext Transfer Protocol (HTTP) Status Code Registry
2//! # Data Source:
3//! [IANA's](https://www.iana.org/)
4//! [HTTP Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
5
6/// Representation of the official HTTP status code registry.
7///
8/// Source's last update: 2025-09-15
9///
10/// Tuple values represent the status code, description, references, links to references.
11pub const CODE_REGISTRY: [(usize, &str, &str, &str); 64] = [
12    // Use python script `convert_source_data.py` to produce these
13    // Rust code tuples from the source csv file.
14    // (Value, "Description", "Reference", "Link")
15    (
16        100,
17        "Continue",
18        "[RFC9110, Section 15.2.1]",
19        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.2.1",
20    ),
21    (
22        101,
23        "Switching Protocols",
24        "[RFC9110, Section 15.2.2]",
25        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.2.2",
26    ),
27    (102, "Processing", "[RFC2518]", "https://www.rfc-editor.org/rfc/rfc2518.html"),
28    (103, "Early Hints", "[RFC8297]", "https://www.rfc-editor.org/rfc/rfc8297.html"),
29    (
30        104,
31        "Upload Resumption Supported (TEMPORARY - registered 2024-11-13, extension registered 2025-09-15, expires 2026-11-13)",
32        "[draft-ietf-httpbis-resumable-upload-05]",
33        "https://www.iana.org/go/draft-ietf-httpbis-resumable-upload-05",
34    ),
35    (200, "OK", "[RFC9110, Section 15.3.1]", "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.1"),
36    (
37        201,
38        "Created",
39        "[RFC9110, Section 15.3.2]",
40        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.2",
41    ),
42    (
43        202,
44        "Accepted",
45        "[RFC9110, Section 15.3.3]",
46        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.3",
47    ),
48    (
49        203,
50        "Non-Authoritative Information",
51        "[RFC9110, Section 15.3.4]",
52        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.4",
53    ),
54    (
55        204,
56        "No Content",
57        "[RFC9110, Section 15.3.5]",
58        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.5",
59    ),
60    (
61        205,
62        "Reset Content",
63        "[RFC9110, Section 15.3.6]",
64        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.6",
65    ),
66    (
67        206,
68        "Partial Content",
69        "[RFC9110, Section 15.3.7]",
70        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.7",
71    ),
72    (207, "Multi-Status", "[RFC4918]", "https://www.rfc-editor.org/rfc/rfc4918.html"),
73    (208, "Already Reported", "[RFC5842]", "https://www.rfc-editor.org/rfc/rfc5842.html"),
74    (226, "IM Used", "[RFC3229]", "https://www.rfc-editor.org/rfc/rfc3229.html"),
75    (
76        300,
77        "Multiple Choices",
78        "[RFC9110, Section 15.4.1]",
79        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.1",
80    ),
81    (
82        301,
83        "Moved Permanently",
84        "[RFC9110, Section 15.4.2]",
85        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.2",
86    ),
87    (
88        302,
89        "Found",
90        "[RFC9110, Section 15.4.3]",
91        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.3",
92    ),
93    (
94        303,
95        "See Other",
96        "[RFC9110, Section 15.4.4]",
97        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.4",
98    ),
99    (
100        304,
101        "Not Modified",
102        "[RFC9110, Section 15.4.5]",
103        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.5",
104    ),
105    (
106        305,
107        "Use Proxy",
108        "[RFC9110, Section 15.4.6]",
109        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.6",
110    ),
111    (
112        306,
113        "(Unused)",
114        "[RFC9110, Section 15.4.7]",
115        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.7",
116    ),
117    (
118        307,
119        "Temporary Redirect",
120        "[RFC9110, Section 15.4.8]",
121        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.8",
122    ),
123    (
124        308,
125        "Permanent Redirect",
126        "[RFC9110, Section 15.4.9]",
127        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.9",
128    ),
129    (
130        400,
131        "Bad Request",
132        "[RFC9110, Section 15.5.1]",
133        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1",
134    ),
135    (
136        401,
137        "Unauthorized",
138        "[RFC9110, Section 15.5.2]",
139        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.2",
140    ),
141    (
142        402,
143        "Payment Required",
144        "[RFC9110, Section 15.5.3]",
145        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.3",
146    ),
147    (
148        403,
149        "Forbidden",
150        "[RFC9110, Section 15.5.4]",
151        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.4",
152    ),
153    (
154        404,
155        "Not Found",
156        "[RFC9110, Section 15.5.5]",
157        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.5",
158    ),
159    (
160        405,
161        "Method Not Allowed",
162        "[RFC9110, Section 15.5.6]",
163        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.6",
164    ),
165    (
166        406,
167        "Not Acceptable",
168        "[RFC9110, Section 15.5.7]",
169        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.7",
170    ),
171    (
172        407,
173        "Proxy Authentication Required",
174        "[RFC9110, Section 15.5.8]",
175        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.8",
176    ),
177    (
178        408,
179        "Request Timeout",
180        "[RFC9110, Section 15.5.9]",
181        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.9",
182    ),
183    (
184        409,
185        "Conflict",
186        "[RFC9110, Section 15.5.10]",
187        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.10",
188    ),
189    (
190        410,
191        "Gone",
192        "[RFC9110, Section 15.5.11]",
193        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.11",
194    ),
195    (
196        411,
197        "Length Required",
198        "[RFC9110, Section 15.5.12]",
199        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.12",
200    ),
201    (
202        412,
203        "Precondition Failed",
204        "[RFC9110, Section 15.5.13]",
205        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.13",
206    ),
207    (
208        413,
209        "Content Too Large",
210        "[RFC9110, Section 15.5.14]",
211        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.14",
212    ),
213    (
214        414,
215        "URI Too Long",
216        "[RFC9110, Section 15.5.15]",
217        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.15",
218    ),
219    (
220        415,
221        "Unsupported Media Type",
222        "[RFC9110, Section 15.5.16]",
223        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.16",
224    ),
225    (
226        416,
227        "Range Not Satisfiable",
228        "[RFC9110, Section 15.5.17]",
229        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.17",
230    ),
231    (
232        417,
233        "Expectation Failed",
234        "[RFC9110, Section 15.5.18]",
235        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.18",
236    ),
237    (
238        418,
239        "(Unused)",
240        "[RFC9110, Section 15.5.19]",
241        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.19",
242    ),
243    (
244        421,
245        "Misdirected Request",
246        "[RFC9110, Section 15.5.20]",
247        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.20",
248    ),
249    (
250        422,
251        "Unprocessable Content",
252        "[RFC9110, Section 15.5.21]",
253        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.21",
254    ),
255    (423, "Locked", "[RFC4918]", "https://www.rfc-editor.org/rfc/rfc4918.html"),
256    (424, "Failed Dependency", "[RFC4918]", "https://www.rfc-editor.org/rfc/rfc4918.html"),
257    (425, "Too Early", "[RFC8470]", "https://www.rfc-editor.org/rfc/rfc8470.html"),
258    (
259        426,
260        "Upgrade Required",
261        "[RFC9110, Section 15.5.22]",
262        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.22",
263    ),
264    (428, "Precondition Required", "[RFC6585]", "https://www.rfc-editor.org/rfc/rfc6585.html"),
265    (429, "Too Many Requests", "[RFC6585]", "https://www.rfc-editor.org/rfc/rfc6585.html"),
266    (431, "Request Header Fields Too Large", "[RFC6585]", "https://www.rfc-editor.org/rfc/rfc6585.html"),
267    (451, "Unavailable For Legal Reasons", "[RFC7725]", "https://www.rfc-editor.org/rfc/rfc7725.html"),
268    (
269        500,
270        "Internal Server Error",
271        "[RFC9110, Section 15.6.1]",
272        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.1",
273    ),
274    (
275        501,
276        "Not Implemented",
277        "[RFC9110, Section 15.6.2]",
278        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.2",
279    ),
280    (
281        502,
282        "Bad Gateway",
283        "[RFC9110, Section 15.6.3]",
284        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.3",
285    ),
286    (
287        503,
288        "Service Unavailable",
289        "[RFC9110, Section 15.6.4]",
290        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.4",
291    ),
292    (
293        504,
294        "Gateway Timeout",
295        "[RFC9110, Section 15.6.5]",
296        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.5",
297    ),
298    (
299        505,
300        "HTTP Version Not Supported",
301        "[RFC9110, Section 15.6.6]",
302        "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.6",
303    ),
304    (506, "Variant Also Negotiates", "[RFC2295]", "https://www.rfc-editor.org/rfc/rfc2295.html"),
305    (507, "Insufficient Storage", "[RFC4918]", "https://www.rfc-editor.org/rfc/rfc4918.html"),
306    (508, "Loop Detected", "[RFC5842]", "https://www.rfc-editor.org/rfc/rfc5842.html"),
307    (
308        510,
309        "Not Extended (OBSOLETED)",
310        "[RFC2774][Status change of HTTP experiments to Historic]",
311        "https://www.rfc-editor.org/rfc/rfc2774.html",
312    ),
313    (511, "Network Authentication Required", "[RFC6585]", "https://www.rfc-editor.org/rfc/rfc6585.html"),
314];
315
316/// Representation of an unofficial HTTP status code registry. Includes a few proposed or popular
317/// unofficial HTTP status codes.
318///
319/// Tuple values represent the status code, description, references, links to references.
320///
321/// Thanks go to Evert Pot and his [Series of posts on HTTP status codes](https://evertpot.com/http/).
322pub const UNOFFICIAL_CODE_REGISTRY: [(usize, &str, &str, &str); 4] = [
323    // (Value, "Description", "Reference", "Link")
324    (
325        306,
326        "Switch Proxy",
327        "[draft-cohen-http-305-306-responses-00]",
328        "[https://datatracker.ietf.org/doc/html/draft-cohen-http-305-306-responses-00]",
329    ),
330    (
331        418,
332        "I'm a teapot",
333        "[RFC2324, Section 2.3.2]",
334        "https://www.rfc-editor.org/rfc/rfc2324.html#section-2.3.2",
335    ),
336    (
337        420,
338        "Enhance your calm",
339        "[Series of posts on HTTP status codes]",
340        "https://evertpot.com/http/420-enhance-your-calm",
341    ),
342    (
343        430,
344        "Would Block",
345        "[draft-nottingham-http-pipeline-01]",
346        "https://datatracker.ietf.org/doc/html/draft-nottingham-http-pipeline-01",
347    ),
348];