Skip to content

Commit c88f839

Browse files
author
Pi-Cla
authored
Update StatusCode documentation to RFC 9110 (#690)
1 parent ec95511 commit c88f839

File tree

1 file changed

+61
-61
lines changed

1 file changed

+61
-61
lines changed

src/status.rs

+61-61
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::fmt;
2020
use std::num::NonZeroU16;
2121
use std::str::FromStr;
2222

23-
/// An HTTP status code (`status-code` in RFC 7230 et al.).
23+
/// An HTTP status code (`status-code` in RFC 9110 et al.).
2424
///
2525
/// Constants are provided for known status codes, including those in the IANA
2626
/// [HTTP Status Code Registry](
@@ -326,195 +326,195 @@ macro_rules! status_codes {
326326

327327
status_codes! {
328328
/// 100 Continue
329-
/// [[RFC7231, Section 6.2.1](https://tools.ietf.org/html/rfc7231#section-6.2.1)]
329+
/// [[RFC9110, Section 15.2.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.2.1)]
330330
(100, CONTINUE, "Continue");
331331
/// 101 Switching Protocols
332-
/// [[RFC7231, Section 6.2.2](https://tools.ietf.org/html/rfc7231#section-6.2.2)]
332+
/// [[RFC9110, Section 15.2.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.2.2)]
333333
(101, SWITCHING_PROTOCOLS, "Switching Protocols");
334334
/// 102 Processing
335-
/// [[RFC2518](https://tools.ietf.org/html/rfc2518)]
335+
/// [[RFC2518, Section 10.1](https://datatracker.ietf.org/doc/html/rfc2518#section-10.1)]
336336
(102, PROCESSING, "Processing");
337337

338338
/// 200 OK
339-
/// [[RFC7231, Section 6.3.1](https://tools.ietf.org/html/rfc7231#section-6.3.1)]
339+
/// [[RFC9110, Section 15.3.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.1)]
340340
(200, OK, "OK");
341341
/// 201 Created
342-
/// [[RFC7231, Section 6.3.2](https://tools.ietf.org/html/rfc7231#section-6.3.2)]
342+
/// [[RFC9110, Section 15.3.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.2)]
343343
(201, CREATED, "Created");
344344
/// 202 Accepted
345-
/// [[RFC7231, Section 6.3.3](https://tools.ietf.org/html/rfc7231#section-6.3.3)]
345+
/// [[RFC9110, Section 15.3.3](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.3)]
346346
(202, ACCEPTED, "Accepted");
347347
/// 203 Non-Authoritative Information
348-
/// [[RFC7231, Section 6.3.4](https://tools.ietf.org/html/rfc7231#section-6.3.4)]
348+
/// [[RFC9110, Section 15.3.4](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.4)]
349349
(203, NON_AUTHORITATIVE_INFORMATION, "Non Authoritative Information");
350350
/// 204 No Content
351-
/// [[RFC7231, Section 6.3.5](https://tools.ietf.org/html/rfc7231#section-6.3.5)]
351+
/// [[RFC9110, Section 15.3.5](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.5)]
352352
(204, NO_CONTENT, "No Content");
353353
/// 205 Reset Content
354-
/// [[RFC7231, Section 6.3.6](https://tools.ietf.org/html/rfc7231#section-6.3.6)]
354+
/// [[RFC9110, Section 15.3.6](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.6)]
355355
(205, RESET_CONTENT, "Reset Content");
356356
/// 206 Partial Content
357-
/// [[RFC7233, Section 4.1](https://tools.ietf.org/html/rfc7233#section-4.1)]
357+
/// [[RFC9110, Section 15.3.7](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.7)]
358358
(206, PARTIAL_CONTENT, "Partial Content");
359359
/// 207 Multi-Status
360-
/// [[RFC4918](https://tools.ietf.org/html/rfc4918)]
360+
/// [[RFC4918, Section 11.1](https://datatracker.ietf.org/doc/html/rfc4918#section-11.1)]
361361
(207, MULTI_STATUS, "Multi-Status");
362362
/// 208 Already Reported
363-
/// [[RFC5842](https://tools.ietf.org/html/rfc5842)]
363+
/// [[RFC5842, Section 7.1](https://datatracker.ietf.org/doc/html/rfc5842#section-7.1)]
364364
(208, ALREADY_REPORTED, "Already Reported");
365365

366366
/// 226 IM Used
367-
/// [[RFC3229](https://tools.ietf.org/html/rfc3229)]
367+
/// [[RFC3229, Section 10.4.1](https://datatracker.ietf.org/doc/html/rfc3229#section-10.4.1)]
368368
(226, IM_USED, "IM Used");
369369

370370
/// 300 Multiple Choices
371-
/// [[RFC7231, Section 6.4.1](https://tools.ietf.org/html/rfc7231#section-6.4.1)]
371+
/// [[RFC9110, Section 15.4.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.1)]
372372
(300, MULTIPLE_CHOICES, "Multiple Choices");
373373
/// 301 Moved Permanently
374-
/// [[RFC7231, Section 6.4.2](https://tools.ietf.org/html/rfc7231#section-6.4.2)]
374+
/// [[RFC9110, Section 15.4.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.2)]
375375
(301, MOVED_PERMANENTLY, "Moved Permanently");
376376
/// 302 Found
377-
/// [[RFC7231, Section 6.4.3](https://tools.ietf.org/html/rfc7231#section-6.4.3)]
377+
/// [[RFC9110, Section 15.4.3](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.3)]
378378
(302, FOUND, "Found");
379379
/// 303 See Other
380-
/// [[RFC7231, Section 6.4.4](https://tools.ietf.org/html/rfc7231#section-6.4.4)]
380+
/// [[RFC9110, Section 15.4.4](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.4)]
381381
(303, SEE_OTHER, "See Other");
382382
/// 304 Not Modified
383-
/// [[RFC7232, Section 4.1](https://tools.ietf.org/html/rfc7232#section-4.1)]
383+
/// [[RFC9110, Section 15.4.5](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.5)]
384384
(304, NOT_MODIFIED, "Not Modified");
385385
/// 305 Use Proxy
386-
/// [[RFC7231, Section 6.4.5](https://tools.ietf.org/html/rfc7231#section-6.4.5)]
386+
/// [[RFC9110, Section 15.4.6](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.6)]
387387
(305, USE_PROXY, "Use Proxy");
388388
/// 307 Temporary Redirect
389-
/// [[RFC7231, Section 6.4.7](https://tools.ietf.org/html/rfc7231#section-6.4.7)]
389+
/// [[RFC9110, Section 15.4.7](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.7)]
390390
(307, TEMPORARY_REDIRECT, "Temporary Redirect");
391391
/// 308 Permanent Redirect
392-
/// [[RFC7238](https://tools.ietf.org/html/rfc7238)]
392+
/// [[RFC9110, Section 15.4.8](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.8)]
393393
(308, PERMANENT_REDIRECT, "Permanent Redirect");
394394

395395
/// 400 Bad Request
396-
/// [[RFC7231, Section 6.5.1](https://tools.ietf.org/html/rfc7231#section-6.5.1)]
396+
/// [[RFC9110, Section 15.5.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.1)]
397397
(400, BAD_REQUEST, "Bad Request");
398398
/// 401 Unauthorized
399-
/// [[RFC7235, Section 3.1](https://tools.ietf.org/html/rfc7235#section-3.1)]
399+
/// [[RFC9110, Section 15.5.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.2)]
400400
(401, UNAUTHORIZED, "Unauthorized");
401401
/// 402 Payment Required
402-
/// [[RFC7231, Section 6.5.2](https://tools.ietf.org/html/rfc7231#section-6.5.2)]
402+
/// [[RFC9110, Section 15.5.3](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.3)]
403403
(402, PAYMENT_REQUIRED, "Payment Required");
404404
/// 403 Forbidden
405-
/// [[RFC7231, Section 6.5.3](https://tools.ietf.org/html/rfc7231#section-6.5.3)]
405+
/// [[RFC9110, Section 15.5.4](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.4)]
406406
(403, FORBIDDEN, "Forbidden");
407407
/// 404 Not Found
408-
/// [[RFC7231, Section 6.5.4](https://tools.ietf.org/html/rfc7231#section-6.5.4)]
408+
/// [[RFC9110, Section 15.5.5](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.5)]
409409
(404, NOT_FOUND, "Not Found");
410410
/// 405 Method Not Allowed
411-
/// [[RFC7231, Section 6.5.5](https://tools.ietf.org/html/rfc7231#section-6.5.5)]
411+
/// [[RFC9110, Section 15.5.6](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.6)]
412412
(405, METHOD_NOT_ALLOWED, "Method Not Allowed");
413413
/// 406 Not Acceptable
414-
/// [[RFC7231, Section 6.5.6](https://tools.ietf.org/html/rfc7231#section-6.5.6)]
414+
/// [[RFC9110, Section 15.5.7](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.7)]
415415
(406, NOT_ACCEPTABLE, "Not Acceptable");
416416
/// 407 Proxy Authentication Required
417-
/// [[RFC7235, Section 3.2](https://tools.ietf.org/html/rfc7235#section-3.2)]
417+
/// [[RFC9110, Section 15.5.8](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.8)]
418418
(407, PROXY_AUTHENTICATION_REQUIRED, "Proxy Authentication Required");
419419
/// 408 Request Timeout
420-
/// [[RFC7231, Section 6.5.7](https://tools.ietf.org/html/rfc7231#section-6.5.7)]
420+
/// [[RFC9110, Section 15.5.9](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.9)]
421421
(408, REQUEST_TIMEOUT, "Request Timeout");
422422
/// 409 Conflict
423-
/// [[RFC7231, Section 6.5.8](https://tools.ietf.org/html/rfc7231#section-6.5.8)]
423+
/// [[RFC9110, Section 15.5.10](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.10)]
424424
(409, CONFLICT, "Conflict");
425425
/// 410 Gone
426-
/// [[RFC7231, Section 6.5.9](https://tools.ietf.org/html/rfc7231#section-6.5.9)]
426+
/// [[RFC9110, Section 15.5.11](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.11)]
427427
(410, GONE, "Gone");
428428
/// 411 Length Required
429-
/// [[RFC7231, Section 6.5.10](https://tools.ietf.org/html/rfc7231#section-6.5.10)]
429+
/// [[RFC9110, Section 15.5.12](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.12)]
430430
(411, LENGTH_REQUIRED, "Length Required");
431431
/// 412 Precondition Failed
432-
/// [[RFC7232, Section 4.2](https://tools.ietf.org/html/rfc7232#section-4.2)]
432+
/// [[RFC9110, Section 15.5.13](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.13)]
433433
(412, PRECONDITION_FAILED, "Precondition Failed");
434434
/// 413 Payload Too Large
435-
/// [[RFC7231, Section 6.5.11](https://tools.ietf.org/html/rfc7231#section-6.5.11)]
435+
/// [[RFC9110, Section 15.5.14](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.14)]
436436
(413, PAYLOAD_TOO_LARGE, "Payload Too Large");
437437
/// 414 URI Too Long
438-
/// [[RFC7231, Section 6.5.12](https://tools.ietf.org/html/rfc7231#section-6.5.12)]
438+
/// [[RFC9110, Section 15.5.15](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.15)]
439439
(414, URI_TOO_LONG, "URI Too Long");
440440
/// 415 Unsupported Media Type
441-
/// [[RFC7231, Section 6.5.13](https://tools.ietf.org/html/rfc7231#section-6.5.13)]
441+
/// [[RFC9110, Section 15.5.16](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.16)]
442442
(415, UNSUPPORTED_MEDIA_TYPE, "Unsupported Media Type");
443443
/// 416 Range Not Satisfiable
444-
/// [[RFC7233, Section 4.4](https://tools.ietf.org/html/rfc7233#section-4.4)]
444+
/// [[RFC9110, Section 15.5.17](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.17)]
445445
(416, RANGE_NOT_SATISFIABLE, "Range Not Satisfiable");
446446
/// 417 Expectation Failed
447-
/// [[RFC7231, Section 6.5.14](https://tools.ietf.org/html/rfc7231#section-6.5.14)]
447+
/// [[RFC9110, Section 15.5.18](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.18)]
448448
(417, EXPECTATION_FAILED, "Expectation Failed");
449449
/// 418 I'm a teapot
450-
/// [curiously not registered by IANA but [RFC2324](https://tools.ietf.org/html/rfc2324)]
450+
/// [curiously not registered by IANA but [RFC2324, Section 2.3.2](https://datatracker.ietf.org/doc/html/rfc2324#section-2.3.2)]
451451
(418, IM_A_TEAPOT, "I'm a teapot");
452452

453453
/// 421 Misdirected Request
454-
/// [RFC7540, Section 9.1.2](https://tools.ietf.org/html/rfc7540#section-9.1.2)
454+
/// [[RFC9110, Section 15.5.20](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.20)]
455455
(421, MISDIRECTED_REQUEST, "Misdirected Request");
456456
/// 422 Unprocessable Entity
457-
/// [[RFC4918](https://tools.ietf.org/html/rfc4918)]
457+
/// [[RFC9110, Section 15.5.21](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.21)]
458458
(422, UNPROCESSABLE_ENTITY, "Unprocessable Entity");
459459
/// 423 Locked
460-
/// [[RFC4918](https://tools.ietf.org/html/rfc4918)]
460+
/// [[RFC4918, Section 11.3](https://datatracker.ietf.org/doc/html/rfc4918#section-11.3)]
461461
(423, LOCKED, "Locked");
462462
/// 424 Failed Dependency
463-
/// [[RFC4918](https://tools.ietf.org/html/rfc4918)]
463+
/// [[RFC4918, Section 11.4](https://tools.ietf.org/html/rfc4918#section-11.4)]
464464
(424, FAILED_DEPENDENCY, "Failed Dependency");
465465

466466
/// 426 Upgrade Required
467-
/// [[RFC7231, Section 6.5.15](https://tools.ietf.org/html/rfc7231#section-6.5.15)]
467+
/// [[RFC9110, Section 15.5.22](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.22)]
468468
(426, UPGRADE_REQUIRED, "Upgrade Required");
469469

470470
/// 428 Precondition Required
471-
/// [[RFC6585](https://tools.ietf.org/html/rfc6585)]
471+
/// [[RFC6585, Section 3](https://datatracker.ietf.org/doc/html/rfc6585#section-3)]
472472
(428, PRECONDITION_REQUIRED, "Precondition Required");
473473
/// 429 Too Many Requests
474-
/// [[RFC6585](https://tools.ietf.org/html/rfc6585)]
474+
/// [[RFC6585, Section 4](https://datatracker.ietf.org/doc/html/rfc6585#section-4)]
475475
(429, TOO_MANY_REQUESTS, "Too Many Requests");
476476

477477
/// 431 Request Header Fields Too Large
478-
/// [[RFC6585](https://tools.ietf.org/html/rfc6585)]
478+
/// [[RFC6585, Section 5](https://datatracker.ietf.org/doc/html/rfc6585#section-5)]
479479
(431, REQUEST_HEADER_FIELDS_TOO_LARGE, "Request Header Fields Too Large");
480480

481481
/// 451 Unavailable For Legal Reasons
482-
/// [[RFC7725](https://tools.ietf.org/html/rfc7725)]
482+
/// [[RFC7725, Section 3](https://tools.ietf.org/html/rfc7725#section-3)]
483483
(451, UNAVAILABLE_FOR_LEGAL_REASONS, "Unavailable For Legal Reasons");
484484

485485
/// 500 Internal Server Error
486-
/// [[RFC7231, Section 6.6.1](https://tools.ietf.org/html/rfc7231#section-6.6.1)]
486+
/// [[RFC9110, Section 15.6.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.1)]
487487
(500, INTERNAL_SERVER_ERROR, "Internal Server Error");
488488
/// 501 Not Implemented
489-
/// [[RFC7231, Section 6.6.2](https://tools.ietf.org/html/rfc7231#section-6.6.2)]
489+
/// [[RFC9110, Section 15.6.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.2)]
490490
(501, NOT_IMPLEMENTED, "Not Implemented");
491491
/// 502 Bad Gateway
492-
/// [[RFC7231, Section 6.6.3](https://tools.ietf.org/html/rfc7231#section-6.6.3)]
492+
/// [[RFC9110, Section 15.6.3](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.3)]
493493
(502, BAD_GATEWAY, "Bad Gateway");
494494
/// 503 Service Unavailable
495-
/// [[RFC7231, Section 6.6.4](https://tools.ietf.org/html/rfc7231#section-6.6.4)]
495+
/// [[RFC9110, Section 15.6.4](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.4)]
496496
(503, SERVICE_UNAVAILABLE, "Service Unavailable");
497497
/// 504 Gateway Timeout
498-
/// [[RFC7231, Section 6.6.5](https://tools.ietf.org/html/rfc7231#section-6.6.5)]
498+
/// [[RFC9110, Section 15.6.5](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.5)]
499499
(504, GATEWAY_TIMEOUT, "Gateway Timeout");
500500
/// 505 HTTP Version Not Supported
501-
/// [[RFC7231, Section 6.6.6](https://tools.ietf.org/html/rfc7231#section-6.6.6)]
501+
/// [[RFC9110, Section 15.6.6](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.6)]
502502
(505, HTTP_VERSION_NOT_SUPPORTED, "HTTP Version Not Supported");
503503
/// 506 Variant Also Negotiates
504-
/// [[RFC2295](https://tools.ietf.org/html/rfc2295)]
504+
/// [[RFC2295, Section 8.1](https://datatracker.ietf.org/doc/html/rfc2295#section-8.1)]
505505
(506, VARIANT_ALSO_NEGOTIATES, "Variant Also Negotiates");
506506
/// 507 Insufficient Storage
507-
/// [[RFC4918](https://tools.ietf.org/html/rfc4918)]
507+
/// [[RFC4918, Section 11.5](https://datatracker.ietf.org/doc/html/rfc4918#section-11.5)]
508508
(507, INSUFFICIENT_STORAGE, "Insufficient Storage");
509509
/// 508 Loop Detected
510-
/// [[RFC5842](https://tools.ietf.org/html/rfc5842)]
510+
/// [[RFC5842, Section 7.2](https://datatracker.ietf.org/doc/html/rfc5842#section-7.2)]
511511
(508, LOOP_DETECTED, "Loop Detected");
512512

513513
/// 510 Not Extended
514-
/// [[RFC2774](https://tools.ietf.org/html/rfc2774)]
514+
/// [[RFC2774, Section 7](https://datatracker.ietf.org/doc/html/rfc2774#section-7)]
515515
(510, NOT_EXTENDED, "Not Extended");
516516
/// 511 Network Authentication Required
517-
/// [[RFC6585](https://tools.ietf.org/html/rfc6585)]
517+
/// [[RFC6585, Section 6](https://datatracker.ietf.org/doc/html/rfc6585#section-6)]
518518
(511, NETWORK_AUTHENTICATION_REQUIRED, "Network Authentication Required");
519519
}
520520

0 commit comments

Comments
 (0)