[8] [DFN[[CODE(HTTP)[[[416]]]]]] ([DFN[[[Range Not Satisfiable]]]]) は、[[範囲要求]]の範囲の指定が不適切で結果を返せないことを表す[[状態符号]]です。

;; [9] この[[状態符号]]を使うことは義務付けられておらず、不適切な範囲の時でも通常の
[CODE(HTTP)[[[200]]]] [[応答]]がかわりに返されるかもしれません。

* 仕様書

[REFS[
- [3] '''[CITE@en[RFC 7233 - Hypertext Transfer Protocol (HTTP/1.1): Range Requests]] ([TIME[2014-09-11 09:57:55 +09:00]] 版) <https://tools.ietf.org/html/rfc7233#section-4.4>'''
- [10] [CITE@en[RFC 7233 - Hypertext Transfer Protocol (HTTP/1.1): Range Requests]] ([TIME[2014-09-11 09:57:55 +09:00]] 版) <https://tools.ietf.org/html/rfc7233#section-4.2>
]REFS]

* 意味

[5] [CODE(HTTP)[[[416]]]] は、
[[要求]]の [CODE(HTTP)@en[[[Range:]]]] [[ヘッダー]]で指定された範囲のいずれもが[[選択された表現]]に重ならないか、
指定された範囲が[[非妥当]]か、過度に小さかったり重なり合ったりしているために拒絶することにしたのを示す[[状態符号]]です [SRC[>>3]]。

;; [6] [[バイト範囲]]の[[範囲要求]]の場合には、前者の条件は[[選択された表現]]の長さ以上のバイト位置からはじまる範囲ばかりであることを表しています。
[SRC[>>3]]

* 構文

[7] [[送信者]]は、[[バイト範囲]]の[[範囲要求]]に対する [CODE(HTTP)[[[416]]]] [[応答]]の場合、
[CODE(HTTP)@en[[[Content-Range:]]]] [[ヘッダー]]を[[生成]]する[['''べきです''']] [SRC[>>3, >>10]]。

* 文脈

[11] [CODE[Blocksize:]] に対する[[応答]]で使われます。

* 歴史

[FIG(quote)[
[FIGCAPTION[
[4] RFC 2616 (HTTP/1.1) 10.4.17 416 Requested Range Not Satisfiable
]FIGCAPTION]

> A server SHOULD return a response with this status code if a request
included a Range request-header field (section 14.35), and none of
the range-specifier values in this field overlap the current extent
of the selected resource, and the request did not include an If-Range
request-header field. (For byte-ranges, this means that the first-byte-pos of all of the byte-range-spec values were greater than the
current length of the selected resource.)

要求が [CODE(HTTP)[[[Range]]]] 要求頭欄を含んでいて、その欄の
[CODE(ABNF)[range-specifier]] 値が一つも現在の選択された資源に重ならない場合であって、
要求が [CODE(HTTP)[[[If-Range]]]] 要求頭欄を含んでいない時には、
サーバーはこの状態符号の応答を返す'''べきです'''。
(バイト範囲については、この状態符号は、全ての [CODE(ABNF)[bute-range-spec]]
値について [CODE(ABNF)[first-bute-pos]] が選択された資源の現在の長さよりも大きいことを意味します。)

> When this status code is returned for a byte-range request, the
response SHOULD include a Content-Range entity-header field
specifying the current length of the selected resource (see section
14.16). This response MUST NOT use the multipart/byteranges content-type.

[CODE(ABNF)[byte-range]] 要求にこの状態符号が返される時には、
応答は選択された資源の現在の長さを指定する [CODE(HTTP)[[[Content-Range]]]]
実体頭欄を含める'''べきです'''。
応答は [CODE(MIME)[[[multipart/byterange]]]] 
内容形を使っては'''なりません'''。
]FIG]

[1] この[[状態符号]]は [[RFC2616]] で導入されましたから、
[[RFC2068]] に基づく [[HTTP/1.1]] の実装は対応していないかもしれません。

[2] [CITE[Issue 68298 - chromium - HTTP Error 416 Requested Range caused by Chrome - An open-source browser project to help move the web forward. - Google Project Hosting]]
([TIME[2011-06-29 20:02:59 +09:00]] 版)
<http://code.google.com/p/chromium/issues/detail?id=68298>