[628] HTTP および派生プロトコルでは、一部共通する状態符号が使われています。 先頭1桁は状態符号の分類を表しており、下2桁がその細分類を表しています。
[18] 状態符号は、俗に応答符号とも呼ばれます。 RFC 7230 でも1箇所応答符号と呼んでいるところがありましたが、 正誤表で訂正されています >>17。
[46] 文脈上曖昧でない場合は、 status
ないし code
と略されることがあります。
[51] Fetch Standard は、「状態は符号である >>50」とわけのわからない定義をしています。
[622] 状態符号は、鯖がクライアントの要求を理解し満足しようと試みた結果を説明するものです >>620, >>626。
[623] 応答メッセージの他の部分は、状態符号ごとに定義された意味に照らして解釈されます >>620。
[8] 1xx
は途中経過の応答を表すなど、
HTTP接続の状態の管理にも状態符号は影響を及ぼします。
204
のように状態符号によってメッセージ本体が存在しなくなることもありますが、
新規の状態符号にはそのように HTTPメッセージの構文に影響をあたえることは認められていません
>>7。
[621] 状態符号は、3桁のASCII数字です >>620。
[632] 最初の1桁は分類を表します。 残りの2桁はその分類内の種別を表しています。 >>626
[14] HTTP の仕様書では、 2xx
のように「xx」
を使って当該分類に含まれる状態符号すべてを表しています。
[9] RFC 7231 は、提案中でまだ用いるべきでない状態符号について
4NN
, 3N0
.. 3N9
のような「N」構文を提唱しています >>7。
[11] HTTP から派生したプロトコルの状態符号や HTTP でも非標準の状態符号は、50番台や90番台を使って HTTP の標準の状態符号との衝突を避けようと試みていることがあります。
[48] サーバーが3桁以外のASCII数字列を指定した場合、それが十進整数として解釈されます。 従って非標準な応答の場合は 100 から 999 の範囲の外の数値が得られるかもしれませんし、 非標準な応答は 3桁の整数を表していても先導0により4桁以上になっているかもしれません。
[49] XHR などでは、ネットワークエラーを表すために整数 0
が用いられます。また IE の実装では4桁や5桁の Windows
ライブラリーのエラーコードが状態符号として用いられることがあります。
[33] 次の場面で使われます。
[634] 状態符号は、状態行において理由句と組で記述されます。 仕様書では状態符号に対応する理由句が定義されていますが、 これはあくまで一例に過ぎず、鯖は任意の値を指定できます。
[63] 0
は、ネットワークエラーなどで使われます。古い実装は HTTP
以外のプロトコルの成功の応答も 0
を返すことがあります。
[66] 1xx
は、HTTP接続において特別な扱いを受けます。
[67] 204
、205
、304
の応答は本体を持ちません。
[64] 207
は、複数の応答をまとめたことを表します。
その中に含まれる実際の応答は 2xx
(成功) とは限りません。
[65] 304
は、 3xx
ですがHTTPリダイレクトではありません。
[68] 407
と 511
は、プロキシ認証やネットワーク認証のエラーを表しています。
つまり起源サーバーではなく、途中の他の (第三者の) サーバーが返した応答です。
[629] HTTP のクライアントは、すべての状態符号を理解する必要はありません。
しかし、未対応なら状態符号の最初の1桁 x で表される分類に基づき、
x00
と同じように扱わなければなりません。 >>626
:status
疑似ヘッダー (HTTP)#✎[38] HTTP/2 応答の :status
疑似ヘッダーは、状態符号を表します >>37。
[39] 応答は :status
疑似ヘッダーを含まなければなりません >>37。
[40] :status
疑似ヘッダーが含まれない応答は、
奇形です >>37。
[53] Firefox は最初を採用します。 Chrome は最後を採用します。 どちらもエラーとはしないようです。
[54] 値が数値でないときどう処理するべきかは不明です。
[55] Chrome も Firefox も先頭の非負整数を応答の状態として使います。
非負整数がないとき、どちらも 200
とします。
Chrome はその続きがあれば、理由句として使います。
それ以外の場合や Firefox は、仕様書に由来する標準的な理由句を使います。
仕様書に無いとき、 Chrome は OK
、Firefox は No Reason Phrase
とします。
status
IDL 属性 (XMLHttpRequest)#✎[28] HTTP 以外のプロトコルの場合の status
属性の値について
XHR では規定されていません 。 XHR
から fetch の定義が参照されている WA1 では、非 HTTP
プロトコルの状態符号は HTTP を準用して与えられているかのように扱うとされていますが、
明確な対応関係を規定しているわけではありません。
[29] MDN の文書では file:
や ftp:
は HTTP
では無いので常に 0
を返すと述べられています >>30。
[1] HTTP 及び派生プロトコルでは次のような状態符号が使われています。
状態符号 | 典型的な理由語句 | 出典 |
---|---|---|
0 | HTTP | |
1xx | HTTP, RTSP, SIP | |
100 | Continue | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]) |
100 | Trying | SIP ([RFC 2543], [RFC 3261]), Q4S |
101 | Switching Protocols | HTTP/1.1 ([RFC 2068], [RFC 2616]) |
102 | Processing | HTTP ([RFC 2518]) |
103 | Checkpoint | HTTP |
103 | Access denied while creating Web Service | HTTP |
103 | Early Hints | HTTP |
104 | File Format or Program Error | HTTP |
122 | Request-URI too long | HTTP |
180 | Ringing | SIP ([RFC 2543], [RFC 3261]) |
181 | Call Is Being Forwarded | SIP ([RFC 2543], [RFC 3261]) |
182 | Queued | SIP ([RFC 2543], [RFC 3261]) |
183 | Session Progress | SIP ([RFC 3261]) |
2xx | HTTP, RTSP, SIP | |
200 | OK | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), CGI ([RFC 3875]), SSTP, mediaont-api, Q4S |
201 | Created | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]) |
202 | Accepted | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), SIP ([RFC 3265]) |
203 | Non-Authoritative Information | HTTP/1.1 ([RFC 2068], [RFC 2616]) |
204 | No Content | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), SSTP, mediaont-api |
205 | Reset Content | HTTP ([RFC 2068], [RFC 2616]) |
206 | Partial Content | HTTP ([RFC 2068], [RFC 2616]), mediaont-api |
207 | Multi-Status | HTTP ([RFC 2518]) |
208 | Already Reported | HTTP |
210 | Break | SSTP |
220 | Uses Protocol Extensions | HTTP |
226 | IM Used | HTTP |
235 | Authentication Completed | HTTP (I-D) |
236 | Proxy Authentication Completed | HTTP (I-D) |
250 | Low on Storage Space | RTSP ([RFC 2326]) |
3xx | HTTP, RTSP, SIP | |
300 | Multiple Choices | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
301 | Moved Permanently | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
302 | Moved Temporarily | HTTP ([RFC 1945], [RFC 2068]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
302 | Found | HTTP ([RFC 2616]), CGI ([RFC 3875]) |
303 | See Other | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543]) |
304 | Not Modified | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]) |
305 | Use Proxy | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
306 | Switch Proxy | HTTP (draft-cohen-http-305-306-responses) |
306 | Switch Proxy | HTTP |
307 | Temporary Redirect | HTTP ([RFC 2616]) |
308 | Permanent Redirect | HTTP |
308 | Resume Incomplete | HTTP |
320 | SHTTP Not Modifed | S-HTTP (RFC 2660) |
350 | Resolution Delegated | HTTP (draft-girod-w3-id-res-ext) |
380 | Alternative Service | SIP ([RFC 2543], [RFC 3261]) |
4xx | HTTP, RTSP, SIP | |
400 | Bad Request | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), CGI ([RFC 3875]), SSTP, mediaont-api, Q4S |
401 | Unauthorized | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
402 | Payment Required | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
403 | Forbidden | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
404 | Not Found | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), mediaont-api, Q4S |
405 | Method Not Allowed | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), Q4S |
406 | Not Acceptable | HTTP ([RFC 2068], [RFC 2616]), HTCPCP ([RFC 2324]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), Q4S |
407 | Proxy Authentication Required | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
408 | Request Timeout | HTTP ([RFC 2068], [RFC 2616]), SIP ([RFC 2543], [RFC 3261]), SSTP, Q4S |
408 | Request Time-out | RTSP ([RFC 2326]) |
409 | Conflict | HTTP ([RFC 2068], [RFC 2616]), SIP ([RFC 2543]), SSTP |
410 | Gone | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
411 | Length Required | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543]) |
412 | Precondition Failed | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]) |
413 | Request Entity Too Large | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), Q4S |
414 | Request-URI Too Long | HTTP ([RFC 2068], [RFC 2616]), Q4S |
414 | Request-URI Too Large | RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
415 | Unsupported Media Type | HTTP ([RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), mediaont-api, Q4S |
416 | Requested Range Not Satisfied | HTTP ([RFC 2616]) |
416 | Unsupported URI Scheme | SIP ([RFC 3261]), Q4S |
417 | Expectation Failed | HTTP ([RFC 2616]) |
418 | I'm a teapot | HTCPCP ([RFC 2324]) |
419 | Expectation Failed | HTTP |
419 | Authentication Timeout | HTTP |
420 | HTTP ([IANAREG]) | |
420 | Bad Protocol Extension Request | HTTP |
420 | Refuse | SSTP |
420 | SecurityRetry | S-HTTP (RFC 2660) |
420 | Method Failure | HTTP |
420 | Enhance Your Calm | HTTP |
420 | Policy Not Fulfilled | HTTP |
420 | Bad Extension | SIP ([RFC 2543], [RFC 3261]) |
421 | HTTP ([IANAREG]) | |
421 | Protocol Extension Unknown | HTTP |
421 | Bad Mapping | HTTP |
421 | BogusHeader | S-HTTP (RFC 2660) |
421 | Extension Required | SIP ([RFC 3261]) |
422 | HTTP ([IANAREG]) | |
422 | Unprocessable Entity | HTTP ([RFC 2518]) |
422 | Protocol Extension Refused | HTTP |
422 | SHTTP Proxy Authentication Required | S-HTTP (RFC 2660) |
423 | Locked | HTTP ([RFC 2518], [IANAREG]) |
423 | Bad Protocol Extension Parameters | HTTP |
423 | Interval Too Brief | SIP ([RFC 3261]) |
424 | Failed Dependency | HTTP ([RFC 2518], [IANAREG]) |
425 | Unordered Collection | HTTP |
426 | Abort | HTTP (draft-ietf-tip-usehttp) |
426 | Upgrade Required | HTTP ([RFC 2817], [IANAREG]) |
427 | SOAPAction | HTTP |
428 | Precondition Required | HTTP |
429 | Too Many Requests | HTTP |
430 | WOULD BLOCK | HTTP |
431 | Request Header Fields Too Large | HTTP |
432 | Transition Needed | HTTP (I-D) |
440 | Login Timeout | HTTP |
444 | No Response | HTTP |
449 | Retry With | HTTP |
450 | Blocked by Windows Parental Controls | HTTP |
450 | Authentication mechanism not accepted | HTTP (I-D) |
451 | Unavailable for Legal Reasons | HTTP |
451 | Redirect | HTTP |
451 | Parameter Not Understood | RTSP [RFC 2326] |
452 | Conference Not Found | RTSP [RFC 2326] |
453 | Not Enough Bandwidth | RTSP [RFC 2326] |
454 | Session Not Found | RTSP [RFC 2326] |
455 | Method Not Valid in This State | RTSP [RFC 2326] |
456 | Header Field Not Valid for Resource | RTSP [RFC 2326] |
457 | Invalid Range | RTSP [RFC 2326] |
458 | Parameter Is Read-Only | RTSP [RFC 2326] |
459 | Aggregate operation not allowed | RTSP [RFC 2326] |
460 | Only aggregate operation allowed | RTSP [RFC 2326] |
461 | Unsupported transport | RTSP [RFC 2326] |
462 | Destination unreachable | RTSP [RFC 2326] |
462 | Property not defined in Source Format | mediaont-api |
470 | HTTP | |
480 | Temporarily not available | SIP ([RFC 2543], [RFC 3261]) |
481 | Call Leg/Transaction Does Not Exist | SIP ([RFC 2543], [RFC 3261]) |
482 | Loop Detected | SIP ([RFC 2543], [RFC 3261]) |
483 | Too Many Hops | SIP ([RFC 2543], [RFC 3261]) |
484 | Address Incompleted | SIP ([RFC 2543], [RFC 3261]) |
485 | Ambiguous | SIP ([RFC 2543], [RFC 3261]) |
486 | Busy Here | SIP ([RFC 2543], [RFC 3261]) |
487 | Request Termineted | SIP ([RFC 3261]) |
488 | Not Acceptable Here | SIP ([RFC 3261]) |
489 | Bad Event | SIP ([RFC 3265]) |
491 | Request Pending | SIP ([RFC 3261]) |
493 | Undecipherable | SIP ([RFC 3261]) |
494 | Request Header Too Large | HTTP |
494 | Security Agreement Required | SIP ([RFC 3329]) |
495 | Cert Error | HTTP |
496 | No Cert | HTTP |
497 | HTTP to HTTPS | HTTP |
498 | Token expired/invalid | HTTP |
499 | Client Closed Request | HTTP |
499 | Token required | HTTP |
5xx | HTTP, RTSP, SIP | |
500 | Internal Server Error | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), mediaont-api |
500 | Server Internal Error | Q4S |
501 | Not Implemented | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), CGI ([RFC 3875]), SSTP, Q4S |
502 | Bad Gateway | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
503 | Service Unavailable | HTTP ([RFC 1945], [RFC 2068], [RFC 2616]), RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]), SSTP, Q4S |
504 | Gateway Timeout | HTTP ([RFC 2068], [RFC 2616]) |
504 | Gateway Time-out | RTSP ([RFC 2326]), SIP ([RFC 2543], [RFC 3261]) |
504 | Server Time-out | Q4S |
505 | HTTP Version Not Supported | HTTP ([RFC 2068], [RFC 2616]) |
505 | RTSP Version not supported | RTSP [RFC 2326] |
505 | SIP Version not supported | SIP ([RFC 2543], [RFC 3261]) |
505 | Version Not Supported | Q4S |
506 | Variant Also Negotiates | HTTP ([RFC 2295]) |
507 | Insufficient Storage | HTTP ([RFC 2518]) |
508 | Loop Detected | HTTP |
508 | Cross Server Binding Forbidden | HTTP |
509 | Bandwidth Limit Exceeded | HTTP |
510 | Not Extended | HTTP ([RFC 2774]) |
510 | Not Local IP | SSTP |
511 | Network Authentication Required | HTTP |
511 | In Black List | SSTP |
512 | Invisible | SSTP |
513 | Message Too Large | SIP ([RFC 3161]), Q4S |
520 | Origin Error | HTTP |
520 | Protocol Extension Error | HTTP |
521 | Protocol Extension Not Implemented | HTTP |
522 | Origin Connection Time-out | HTTP |
522 | Protocol Extension Parameters Not Acceptable | HTTP |
523 | HTTP | |
524 | Origin Time-out | HTTP |
529 | HTTP | |
551 | Option not supported | RTSP [RFC 2326] |
555 | HTTP | |
562 | Property not supported | mediaont-api |
564 | ||
580 | Precondition Failure | SIP [RFC 3312] |
591 | Restore successful | HTTP (CEA-2014-B) |
592 | Cannot connect to provided saved state URL | HTTP (CEA-2014-B) |
593 | Unidentified error while restoring | HTTP (CEA-2014-B) |
594 | Save successful | HTTP (CEA-2014-B) |
595 | Page does not include save-restore plugin object | HTTP, HTTP (CEA-2014-B) |
596 | Cannot connect to provided storage server URL | HTTP, HTTP (CEA-2014-B) |
597 | Unidentified error while saving | HTTP, HTTP (CEA-2014-B) |
598 | Network read timeout error | HTTP |
599 | Network connect timeout error | HTTP |
6xx | SIP | |
600 | Busy Everywhere | SIP ([RFC 2543], [RFC 3261]) |
600 | session does not exist | Q4S |
601 | quality level not allowed | Q4S |
603 | Decline | SIP ([RFC 2543], [RFC 3261]) |
603 | Session not allowed | Q4S |
604 | Does not exist anywhere | SIP ([RFC 2543], [RFC 3261]) |
604 | authorization not allowed | Q4S |
606 | Not Acceptable | SIP ([RFC 2543], [RFC 3261]) |
1223 | HTTP | |
12152 | Unknown | HTTP |
[636] JSON 形式の一覧ファイルが >>635 にあります。
[43] 数値が割り当てられずに廃案となった提案:
[608] HTTP の登録簿は RFC 2817 により (ようやく) 設けられました >>609。
[16] その後 RFC 7231 により再定義されています。
[2] RTSP は独自の符号は50番台を使うことで衝突を防いでいます。 (RFC 2326 7.1)
[3] [Apache] apache-1.3/src/main/http_protocol.c http://www.apache.jp/viewcvs.cgi/apache-1.3/src/main/http_protocol.c, httpd-2.0/modules/http/http_protocol.c http://www.apache.jp/viewcvs.cgi/httpd-2.0/modules/http/http_protocol.c
[5] Real Time Streaming Protocol (RTSP)/1.0 Parameters http://www.iana.org/assignments/rtsp-parameters
[19] HTTP 仕様は状態符号の IANA 登録手続きを規定していますが、 登録されていない状態符号の利用を明確に禁じてはいません。
[20] 実際に未登録の状態符号を使った例は多々あります。 (状態符号の IANA登録簿が出来る前から非標準の状態符号は使われていたと思われます。)
[21] >>11 のような工夫が行われることもありますが、行われないこともあります。 そして実際に非標準の状態符号と新たに RFC 化された状態符号が衝突した例もあります。
[24] HTTP の仕様書は 2xx
と 3xx
を除く状態符号の応答を non-error response
と呼んでいます >>23。
[32] WebDAV では状態符号よりも細かいエラーの詳細を XML 形式で表現でき、これを事前条件符号や事後条件符号と呼んでいます。
[72]
CATP のステータスコードは、
HTTP状態符号と同様に3桁で1桁目の意味もおなじですが (但し 1xx
は予約)、
下2桁は実装依存とされています。
>>71
The Status-Code element is a 3-digit integer result code of the attempt to understand and satisfy the request. {2068,2616} These codes are fully defined in section 10. The Reason-Phrase is intended to give a short textual description of the Status-Code. The Status-Code is intended for use by automata and the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason-Phrase.
Status-Code
要素は要求を理解し満足しようと試みた結果の3桁整数符号です。この符号は10章で完全に定義しています。
Reason-Phrase
は Status-Code
の短文の説明を与えることを意図しています。
Status-Code
は自動化に使うことを意図しており、
Reason-Phrase
は人間利用者向けを意図しています。
クライアントが Reason-Phrase
を検査したり表示したりすることは必須ではありません。
The first digit of the Status-Code defines the class of response. The last two digits do not have any categorization role. There are 5 values for the first digit:
Status-Code
の最初の数字は応答の種別を定義します。
後ろの2桁は分類的役割は持っていません。最初の数字には5つの値があります。
{1945,2068} o{2616} - 1xx: Informational -{1945} Not used, but reserved for future use{2068,2616} Request received, continuing process{1945,2068} o{2616} - 2xx: Success - The action was successfully received, understood, and accepted.{1945,2068} o{2616} - 3xx: Redirection - Further action must be taken in order to complete the request{1945,2068} o{2616} - 4xx: Client Error - The request contains bad syntax or cannot be fulfilled{1945,2068} o{2616} - 5xx: Server Error - The server failed to fulfill an apparently valid request
1xx
: 情報提供 — 2xx
: 成功 — 動作は成功裏に受信し、理解し、受け入れた3xx
: 再指向 — 要求を完了するためには更なる動作を取らなければならない4xx
: クライアント誤り — 要求は悪い構文を含んでいるか、または満たすことができない5xx
: サーバー誤り — サーバーは妥当そうな要求を満たすことに失敗したThe individual values of the numeric status codes defined for
{1945} HTTP/1.0{2068,2616} HTTP/1.1, and an example set of corresponding Reason-Phrase's, are presented below. The reason phrases listed here are only{1945,2068} recommended{2616} recommendations -- they{1945,2068} may{2616} MAY be replaced by local equivalents without affecting the protocol.These codes are fully defined in Section 9.
HTTP 用に定義した数値状態符号の個々の値と対応する Reason-Phrase
の例の集合を次に示します。
ここに挙げた理由語句は推奨に過ぎません。
プロトコルに影響なく局所的な同等のものに置換えて構いません。
{1945}
Status-Code = "200" ; OK | "201" ; Created | "202" ; Accepted | "204" ; No Content | "301" ; Moved Permanently | "302" ; Moved Temporarily | "304" ; Not Modified | "400" ; Bad Request | "401" ; Unauthorized | "403" ; Forbidden | "404" ; Not Found | "500" ; Internal Server Error | "501" ; Not Implemented | "502" ; Bad Gateway | "503" ; Service Unavailable | extension-code
{2068}
Status-Code = "100" ; Continue | "101" ; Switching Protocols | "200" ; OK | "201" ; Created | "202" ; Accepted | "203" ; Non-Authoritative Information | "204" ; No Content | "205" ; Reset Content | "206" ; Partial Content | "300" ; Multiple Choices | "301" ; Moved Permanently | "302" ; Moved Temporarily | "303" ; See Other | "304" ; Not Modified | "305" ; Use Proxy | "400" ; Bad Request | "401" ; Unauthorized | "402" ; Payment Required | "403" ; Forbidden | "404" ; Not Found | "405" ; Method Not Allowed | "406" ; Not Acceptable | "407" ; Proxy Authentication Required | "408" ; Request Time-out | "409" ; Conflict | "410" ; Gone | "411" ; Length Required | "412" ; Precondition Failed | "413" ; Request Entity Too Large | "414" ; Request-URI Too Large | "415" ; Unsupported Media Type | "500" ; Internal Server Error | "501" ; Not Implemented | "502" ; Bad Gateway | "503" ; Service Unavailable | "504" ; Gateway Time-out | "505" ; HTTP Version not supported | extension-code
{2616}
Status-Code = "100" ; Section 10.1.1: Continue | "101" ; Section 10.1.2: Switching Protocols | "200" ; Section 10.2.1: OK | "201" ; Section 10.2.2: Created | "202" ; Section 10.2.3: Accepted | "203" ; Section 10.2.4: Non-Authoritative Information | "204" ; Section 10.2.5: No Content | "205" ; Section 10.2.6: Reset Content | "206" ; Section 10.2.7: Partial Content | "300" ; Section 10.3.1: Multiple Choices | "301" ; Section 10.3.2: Moved Permanently | "302" ; Section 10.3.3: Found | "303" ; Section 10.3.4: See Other | "304" ; Section 10.3.5: Not Modified | "305" ; Section 10.3.6: Use Proxy | "307" ; Section 10.3.8: Temporary Redirect | "400" ; Section 10.4.1: Bad Request | "401" ; Section 10.4.2: Unauthorized | "402" ; Section 10.4.3: Payment Required | "403" ; Section 10.4.4: Forbidden | "404" ; Section 10.4.5: Not Found | "405" ; Section 10.4.6: Method Not Allowed | "406" ; Section 10.4.7: Not Acceptable | "407" ; Section 10.4.8: Proxy Authentication Required | "408" ; Section 10.4.9: Request Time-out | "409" ; Section 10.4.10: Conflict | "410" ; Section 10.4.11: Gone | "411" ; Section 10.4.12: Length Required | "412" ; Section 10.4.13: Precondition Failed | "413" ; Section 10.4.14: Request Entity Too Large | "414" ; Section 10.4.15: Request-URI Too Large | "415" ; Section 10.4.16: Unsupported Media Type | "416" ; Section 10.4.17: Requested range not satisfiable | "417" ; Section 10.4.18: Expectation Failed | "500" ; Section 10.5.1: Internal Server Error | "501" ; Section 10.5.2: Not Implemented | "502" ; Section 10.5.3: Bad Gateway | "503" ; Section 10.5.4: Service Unavailable | "504" ; Section 10.5.5: Gateway Time-out | "505" ; Section 10.5.6: HTTP Version not supported | extension-code
- extension-code = 3DIGIT
- Reason-Phrase = *<TEXT, excluding CR, LF>
HTTP status codes are extensible
, {1945} but the above codes are the only ones generally recognized in current practice. HTTP applications are not required to understand the meaning of all registered status codes, though such understanding is obviously desirable. However, applications{1945} mustMUST understand the class of any status code, as indicated by the first digit, and treat any unrecognized response as being equivalent to the x00 status code of that class, with the exception that an unrecognized response{1945} must notMUST NOT be cached. For example, if an unrecognized status code of 431 is received by the client, it can safely assume that there was something wrong with its request and treat the response as if it had received a 400 status code. In such cases, user agents{1945} shouldSHOULD present to the user the entity returned with the response, since that entity is likely to include human-readable information which will explain the unusual status.
HTTP 状態符号は拡張可能ですが、上述の符号は現在の慣習で一般的に認識されるもののみです。
HTTP 応用はすべての登録された状態符号の意味を理解できる方が明らかに望ましくはありますが、その必要はありません。
しかし、応用は最初の数字が示す状態符号の種別を理解し、認識できない応答をその種別の
x00
状態符号と同等のものとして扱わなければなりません。
ただし例外として、認識できない応答はキャッシュしてはなりません。
例えば、認識できない 431
の状態符号を蔵あinnとが受信したとしたら、
クライアントはその要求の何かがおかしいのであると安全に仮定でき、
その応答を 400
状態符号で受取ったものとして扱えます。
その場合、利用者エージェントはその応答で返された実体を利用者に提示するべきです。
その実体にはおそらくその普通じゃない状態を説明する人間可読の情報を含んでいることでしょう。
→RFC 3875 6.3.3. Status
[607] draft-nottingham-http-new-status-01 - Additional HTTP Status Codes ( ( 版)) http://tools.ietf.org/html/draft-nottingham-http-new-status-01
[610] RFC 4463 - A Media Resource Control Protocol (MRCP) Developed by Cisco, Nuance, and Speechworks ( ( 版)) http://tools.ietf.org/html/rfc4463#section-5.2.1
[611] RFC 4975 - The Message Session Relay Protocol (MSRP) ( ( 版)) http://tools.ietf.org/html/rfc4975#section-10
[613] RFC 6787 - Media Resource Control Protocol Version 2 (MRCPv2) ( ( 版)) http://tools.ietf.org/html/rfc6787#section-5.4
[614] RFC 6787 - Media Resource Control Protocol Version 2 (MRCPv2) ( ( 版)) http://tools.ietf.org/html/rfc6787#section-13.1.4
[616] Media Resource Control Protocol Version 2 (MRCPv2) Parameters ( ( 版)) http://www.iana.org/assignments/mrcpv2-parameters/mrcpv2-parameters.xhtml#status-codes
[619] Metadata API for Media Resources 1.0 ( ( 版)) http://www.w3.org/TR/mediaont-api-1.0/#api-status-codes
[638] draft-aranda-dispatch-q4s-02 - The Quality for Service Protocol ( ( 版)) http://tools.ietf.org/html/draft-aranda-dispatch-q4s-02#section-4
[57] IETF は2012年4月に RFC 6585 を発行し、 状態符号を4つ規定しています。
[58] この RFC は RFC 2616 を更新する形となっていますが、 単なる追加規定なので、どこが更新なのか謎です。
[44] HTTP/2 では状態行が廃止されています。 SPDY では
status
ヘッダーが使われました。 HTTP/2
では :status
疑似ヘッダーとなっています。
[6]
Force Apache to output any HTTP Status Code with ErrorDocument (2007-03-05 07:36:37 +09:00
版) http://www.askapache.com/2007/htaccess/apache-status-code-headers-errordocument.html
(名無しさん 2007-03-04 22:43:40 +00:00)
[612] AnyEvent::HTTP - search.cpan.org ( 版) http://search.cpan.org/~mlehmann/AnyEvent-HTTP-2.13/HTTP.pm
[617] IIS 7.0、IIS 7.5、および IIS 8.0 の HTTP 状態コード ( ( 版)) http://support.microsoft.com/kb/943891/ja
[618] IISのステータスコードは小数点つきという話 - ういはるかぜの化学 - subtech ( ( 版)) http://subtech.g.hatena.ne.jp/mayuki/20131120/1384901536
[31] LWP で使われるPerlモジュールである HTTP::Response
は、 code
メソッドが状態符号を返します。
[624] CoAP は HTTP と類似した状態符号を使っていますが、 HTTP
の百の位に当たる整数部1桁と、十・一の位にあたる小数部2桁を小数点 .
で連結した表記となっています。整数部は3ビット、小数部は5ビットの整数です。
[625] ただし 0.00
は空メッセージを表すものとされており、
それ以外の整数部が 0 の値はメソッドに割り当てられています。 (CoAP
は HTTP に由来するメソッドを使っていますが、数値が割り当てられています。)
整数部が 1、6、7 の値は予約されています。それ以外、つまり 2、3、4
が状態符号となっています。
[34] IRC logs: freenode / #whatwg / 20150125 ( 版) http://krijnhoetmer.nl/irc-logs/whatwg/20150125
The HTTP response codes are equivalent to statuses in other protocols that have the same basic meanings. For example, a "file not found" error is equivalent to a 404 code, a server error is equivalent to a 5xx code, and so on.
[52] Define status, ok status, and use them both · whatwg/fetch@159d43c ( 版) https://github.com/whatwg/fetch/commit/159d43c7d55e682d7f3fc3cc800d1c004dd183f6
[59] draft-schulzrinne-http-status-00 - Assignment of Status Codes for HTTP and HTTP-Derived Protocols ( 版) https://tools.ietf.org/html/draft-schulzrinne-http-status-00
case '.': /* IIS may send 403.1, 403.2, etc */
[61] Replace 'HTTP status code' with 'HTTP status' (vkatsikaros著, ) https://github.com/w3c/webdriver/commit/30ed50c68b8c52da7996df8e5e037f838ee9b826
エラーの際でも、HTTPレスポンスステータスは常に "200 OK" が返ります。実装側では常にレスポンスXMLの内容を見てエラー判断を行ってください。
[70] Make status message default to the empty byte sequence (annevk著, ) https://github.com/whatwg/fetch/commit/0dec453f642c1fe57e6e7627c9a66cf7f8b8394d