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