Skip to content

Commit b85530e

Browse files
committed
Adding links to references
1 parent 71bae5c commit b85530e

File tree

1 file changed

+180
-26
lines changed

1 file changed

+180
-26
lines changed

lib/net/http/responses.rb

Lines changed: 180 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -413,23 +413,41 @@ class HTTPPermanentRedirect < HTTPRedirection
413413
# Response class for <tt>Bad Request</tt> responses (status code 400).
414414
#
415415
# The server cannot or will not process the request due to an apparent client error.
416-
# See {400 Bad Request}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#400].
416+
#
417+
# References:
418+
#
419+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400].
420+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request].
421+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#400].
422+
#
417423
class HTTPBadRequest < HTTPClientError
418424
HAS_BODY = true
419425
end
420426

421427
# Response class for <tt>Unauthorized</tt> responses (status code 401).
422428
#
423429
# Authentication is required, but either was not provided or failed.
424-
# See {401 Unauthorized}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#401].
430+
#
431+
# References:
432+
#
433+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401].
434+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized].
435+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#401].
436+
#
425437
class HTTPUnauthorized < HTTPClientError
426438
HAS_BODY = true
427439
end
428440

429441
# Response class for <tt>Payment Required</tt> responses (status code 402).
430442
#
431443
# Reserved for future use.
432-
# See {402 Payment Required}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#402].
444+
#
445+
# References:
446+
#
447+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/402].
448+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-402-payment-required].
449+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#402].
450+
#
433451
class HTTPPaymentRequired < HTTPClientError
434452
HAS_BODY = true
435453
end
@@ -438,23 +456,41 @@ class HTTPPaymentRequired < HTTPClientError
438456
#
439457
# The request contained valid data and was understood by the server,
440458
# but the server is refusing action.
441-
# See {403 Forbidden}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#403].
459+
#
460+
# References:
461+
#
462+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403].
463+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-403-forbidden].
464+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#403].
465+
#
442466
class HTTPForbidden < HTTPClientError
443467
HAS_BODY = true
444468
end
445469

446470
# Response class for <tt>Not Found</tt> responses (status code 404).
447471
#
448472
# The requested resource could not be found but may be available in the future.
449-
# See {404 Not Found}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#404].
473+
#
474+
# References:
475+
#
476+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404].
477+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found].
478+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#404].
479+
#
450480
class HTTPNotFound < HTTPClientError
451481
HAS_BODY = true
452482
end
453483

454484
# Response class for <tt>Method Not Allowed</tt> responses (status code 405).
455485
#
456486
# The request method is not supported for the requested resource.
457-
# See {405 Method Not Allowed}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#405].
487+
#
488+
# References:
489+
#
490+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405].
491+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-405-method-not-allowed].
492+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#405].
493+
#
458494
class HTTPMethodNotAllowed < HTTPClientError
459495
HAS_BODY = true
460496
end
@@ -463,23 +499,41 @@ class HTTPMethodNotAllowed < HTTPClientError
463499
#
464500
# The requested resource is capable of generating only content
465501
# that not acceptable according to the Accept headers sent in the request.
466-
# See {406 Not Acceptable}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#406].
502+
#
503+
# References:
504+
#
505+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406].
506+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-406-not-acceptable].
507+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#406].
508+
#
467509
class HTTPNotAcceptable < HTTPClientError
468510
HAS_BODY = true
469511
end
470512

471513
# Response class for <tt>Proxy Authentication Required</tt> responses (status code 407).
472514
#
473515
# The client must first authenticate itself with the proxy.
474-
# See {407 Proxy Authentication Required}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#407].
516+
#
517+
# References:
518+
#
519+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407].
520+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-407-proxy-authentication-re].
521+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#407].
522+
#
475523
class HTTPProxyAuthenticationRequired < HTTPClientError
476524
HAS_BODY = true
477525
end
478526

479527
# Response class for <tt>Request Timeout</tt> responses (status code 408).
480528
#
481529
# The server timed out waiting for the request.
482-
# See {408 Request Timeout}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#408].
530+
#
531+
# References:
532+
#
533+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408].
534+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-408-request-timeout].
535+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#408].
536+
#
483537
class HTTPRequestTimeout < HTTPClientError
484538
HAS_BODY = true
485539
end
@@ -488,7 +542,13 @@ class HTTPRequestTimeout < HTTPClientError
488542
# Response class for <tt>Conflict</tt> responses (status code 409).
489543
#
490544
# The request could not be processed because of conflict in the current state of the resource.
491-
# See {409 Conflict}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#409].
545+
#
546+
# References:
547+
#
548+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409].
549+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-409-conflict].
550+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#409].
551+
#
492552
class HTTPConflict < HTTPClientError
493553
HAS_BODY = true
494554
end
@@ -497,7 +557,13 @@ class HTTPConflict < HTTPClientError
497557
#
498558
# The resource requested was previously in use but is no longer available
499559
# and will not be available again.
500-
# See {410 Gone}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#410].
560+
#
561+
# References:
562+
#
563+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410].
564+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-410-gone].
565+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#410].
566+
#
501567
class HTTPGone < HTTPClientError
502568
HAS_BODY = true
503569
end
@@ -506,7 +572,13 @@ class HTTPGone < HTTPClientError
506572
#
507573
# The request did not specify the length of its content,
508574
# which is required by the requested resource.
509-
# See {411 Length Required}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#411].
575+
#
576+
# References:
577+
#
578+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/411].
579+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-411-length-required].
580+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#411].
581+
#
510582
class HTTPLengthRequired < HTTPClientError
511583
HAS_BODY = true
512584
end
@@ -515,15 +587,27 @@ class HTTPLengthRequired < HTTPClientError
515587
#
516588
# The server does not meet one of the preconditions
517589
# specified in the request headers.
518-
# See {412 Precondition Failed}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#412].
590+
#
591+
# References:
592+
#
593+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412].
594+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-412-precondition-failed].
595+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#412].
596+
#
519597
class HTTPPreconditionFailed < HTTPClientError
520598
HAS_BODY = true
521599
end
522600

523601
# Response class for <tt>Payload Too Large</tt> responses (status code 413).
524602
#
525603
# The request is larger than the server is willing or able to process.
526-
# See {413 Payload Too Large}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#413].
604+
#
605+
# References:
606+
#
607+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413].
608+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-413-content-too-large].
609+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#413].
610+
#
527611
class HTTPPayloadTooLarge < HTTPClientError
528612
HAS_BODY = true
529613
end
@@ -532,7 +616,13 @@ class HTTPPayloadTooLarge < HTTPClientError
532616
# Response class for <tt>URI Too Long</tt> responses (status code 414).
533617
#
534618
# The URI provided was too long for the server to process.
535-
# See {414 URI Too Long}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#414].
619+
#
620+
# References:
621+
#
622+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414].
623+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-414-uri-too-long].
624+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#414].
625+
#
536626
class HTTPURITooLong < HTTPClientError
537627
HAS_BODY = true
538628
end
@@ -542,15 +632,27 @@ class HTTPURITooLong < HTTPClientError
542632
# Response class for <tt>Unsupported Media Type</tt> responses (status code 415).
543633
#
544634
# The request entity has a media type which the server or resource does not support.
545-
# See {415 Unsupported Media Type}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#415].
635+
#
636+
# References:
637+
#
638+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415].
639+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-415-unsupported-media-type].
640+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#415].
641+
#
546642
class HTTPUnsupportedMediaType < HTTPClientError
547643
HAS_BODY = true
548644
end
549645

550646
# Response class for <tt>Range Not Satisfiable</tt> responses (status code 416).
551647
#
552648
# The request entity has a media type which the server or resource does not support.
553-
# See {416 Range Not Satisfiable}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#416].
649+
#
650+
# References:
651+
#
652+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416].
653+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-416-range-not-satisfiable].
654+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#416].
655+
#
554656
class HTTPRangeNotSatisfiable < HTTPClientError
555657
HAS_BODY = true
556658
end
@@ -559,7 +661,13 @@ class HTTPRangeNotSatisfiable < HTTPClientError
559661
# Response class for <tt>Expectation Failed</tt> responses (status code 417).
560662
#
561663
# The server cannot meet the requirements of the Expect request-header field.
562-
# See {417 Expectation Failed}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#417].
664+
#
665+
# References:
666+
#
667+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/417].
668+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-417-expectation-failed].
669+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#417].
670+
#
563671
class HTTPExpectationFailed < HTTPClientError
564672
HAS_BODY = true
565673
end
@@ -572,23 +680,38 @@ class HTTPExpectationFailed < HTTPClientError
572680
# Response class for <tt>Misdirected Request</tt> responses (status code 421).
573681
#
574682
# The request was directed at a server that is not able to produce a response.
575-
# See {421 Misdirected Request}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#421].
683+
#
684+
# References:
685+
#
686+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-421-misdirected-request].
687+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#421].
688+
#
576689
class HTTPMisdirectedRequest < HTTPClientError
577690
HAS_BODY = true
578691
end
579692

580693
# Response class for <tt>Unprocessable Entity</tt> responses (status code 422).
581694
#
582695
# The request was well-formed but had semantic errors.
583-
# See {422 Unprocessable Entity}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#422].
696+
#
697+
# References:
698+
#
699+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422].
700+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-422-unprocessable-content].
701+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#422].
702+
#
584703
class HTTPUnprocessableEntity < HTTPClientError
585704
HAS_BODY = true
586705
end
587706

588707
# Response class for <tt>Locked (WebDAV)</tt> responses (status code 423).
589708
#
590709
# The requested resource is locked.
591-
# See {423 Locked (WebDAV)}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#423].
710+
#
711+
# References:
712+
#
713+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#423].
714+
#
592715
class HTTPLocked < HTTPClientError
593716
HAS_BODY = true
594717
end
@@ -597,6 +720,11 @@ class HTTPLocked < HTTPClientError
597720
#
598721
# The request failed because it depended on another request and that request failed.
599722
# See {424 Failed Dependency (WebDAV)}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#424].
723+
#
724+
# References:
725+
#
726+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#424].
727+
#
600728
class HTTPFailedDependency < HTTPClientError
601729
HAS_BODY = true
602730
end
@@ -607,23 +735,39 @@ class HTTPFailedDependency < HTTPClientError
607735
# Response class for <tt>Upgrade Required</tt> responses (status code 426).
608736
#
609737
# The client should switch to the protocol given in the Upgrade header field.
610-
# See {426 Upgrade Required}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#426].
738+
#
739+
# References:
740+
#
741+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/426].
742+
# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-426-upgrade-required].
743+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#426].
744+
#
611745
class HTTPUpgradeRequired < HTTPClientError
612746
HAS_BODY = true
613747
end
614748

615749
# Response class for <tt>Precondition Required</tt> responses (status code 428).
616750
#
617751
# The origin server requires the request to be conditional.
618-
# See {428 Precondition Required}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#428].
752+
#
753+
# References:
754+
#
755+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/428].
756+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#428].
757+
#
619758
class HTTPPreconditionRequired < HTTPClientError
620759
HAS_BODY = true
621760
end
622761

623762
# Response class for <tt>Too Many Requests</tt> responses (status code 429).
624763
#
625764
# The user has sent too many requests in a given amount of time.
626-
# See {429 Too Many Requests}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#429].
765+
#
766+
# References:
767+
#
768+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429].
769+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#429].
770+
#
627771
class HTTPTooManyRequests < HTTPClientError
628772
HAS_BODY = true
629773
end
@@ -632,7 +776,12 @@ class HTTPTooManyRequests < HTTPClientError
632776
#
633777
# An individual header field is too large,
634778
# or all the header fields collectively, are too large.
635-
# See {431 Request Header Fields Too Large}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#431].
779+
#
780+
# References:
781+
#
782+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/431].
783+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#431].
784+
#
636785
class HTTPRequestHeaderFieldsTooLarge < HTTPClientError
637786
HAS_BODY = true
638787
end
@@ -641,7 +790,12 @@ class HTTPRequestHeaderFieldsTooLarge < HTTPClientError
641790
#
642791
# A server operator has received a legal demand to deny access to a resource or to a set of resources
643792
# that includes the requested resource.
644-
# See {451 Unavailable For Legal Reasons}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#451].
793+
#
794+
# References:
795+
#
796+
# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/451].
797+
# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#451].
798+
#
645799
class HTTPUnavailableForLegalReasons < HTTPClientError
646800
HAS_BODY = true
647801
end

0 commit comments

Comments
 (0)