[421] [DFN[[CODE(HTTP)[[[417]]]]]] ([DFN[[[Expectation Failed]]]])
は、[[要求メッセージ]]の [CODE(HTTP)@en[[[Expect:]]]] [[ヘッダー]]に[[鯖]]が対応できないことを示します。

* 仕様書

[REFS[
- [418] '''[CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-08-07 05:54:02 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-6.5.14>'''
- [4] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-5.1.1>
]REFS]

* 意味

[419] [CODE(HTTP)[[[417]]]] は、[[要求]]の [CODE(HTTP)@en[[[Expect:]]]]
[[ヘッダー]]で示された期待に[[内向き]]の[[鯖]]のいずれかが応えられないことを示しています [SRC[>>418]]。

* 文脈

[5] [[鯖]]は、[CODE(HTTP)@en[[[Expect:]]]] [[ヘッダー]]で
[CODE(HTTP)@en[[[100-continue]]]] 以外を受信した場合、 
[CODE(HTTP)[[[417]]]] [[応答]]を返して構いません [SRC[>>4]]。

;; [420] [[鯖]]が [CODE(HTTP)@en[[[100-continue]]]] を実装しないことが認められているのかは不明です。
[[鯖]]が対応しない場合には [CODE(HTTP)[[[417]]]] を返して良いとみられます。

[7] [CODE[Expect:]] や [CODE[100-continue]] はほとんど使われておらず、
[CODE[417]] もほとんど利用されていないと推測されます。

* 歴史

[FIG(quote)[
[FIGCAPTION[
[3] RFC 2616 (HTTP/1.1) 10.4.18 417 Expectation Failed
]FIGCAPTION]

> The expectation given in an Expect request-header field (see section
14.20) could not be met by this server, or, if the server is a proxy,
the server has unambiguous evidence that the request could not be met
by the next-hop server.

[CODE(HTTP)[[[Expect]]]] 要求頭欄で与えられた期待にこのサーバーは応えることができないか、又はサーバーが串である場合には、
次のホップのサーバーがその要求に応えることができないという曖昧でない証拠をそのサーバーが握っています。
]FIG]

* メモ

[1] [CITE@en-gb[HTTP Status Codes]]
([[Dan McCormick]] 著, [TIME[2011-10-07 11:42:55 +09:00]] 版)
<http://www.mccormickfamily.com/become-an-author/56-http-status-codes#417>

[2] [CITE[crwlr.net - server header information index | beta]] ([TIME[2014-03-05 09:22:53 +09:00]] 版) <http://crwlr.net/?page=search&q=HTTP%2F1.1+417>

>85.248.69.207
>http://85.248.69.207
>
[PRE(HTTP code)[
HTTP/1.1 417 We are the knights who say... Ni! And we say... Ni!
Content-Type: text/html; charset=utf-8
Retry-After: 5
Content-Length: 515
Accept-Ranges: bytes
Date: Fri, 16 Nov 2012 06:00:15 GMT
Age: 0
Connection: close
Server: ninja web server 1.3.3.7
]PRE]

[FIG(quote)[
[FIGCAPTION[
[6] [CITE[REST API - Firebase]]
([TIME[2015-03-29 19:07:36 +09:00]] 版)
<https://www.firebase.com/docs/rest/api/#section-security-rules>
]FIGCAPTION]

> 417 Expectation Failed	A REST API call that doesn't specify a namespace

]FIG]
