417 Expectation Failed

The server cannot meet the Expect header in the request.

Code
417
Reason phrase
Expectation Failed
Class
4xx Client error
Defined in
RFC 9110 section 15.5.18
Cacheable by default
No

What it means

Client error: the problem lies with the request. Repeating it unchanged will normally fail again.

Common causes. A server or proxy that does not support Expect: 100-continue.

What to do. Send the request without the Expect header.

How clients and crawlers treat it

Google Search. Like every 4xx except 429, it tells Google the content does not exist: an indexed URL is removed from the index, and a new one is not processed. Crawl frequency for the URL gradually drops. Source: Google Search Central, How HTTP status codes, and network and DNS errors affect Google Search.

Caching. Not cacheable by default (RFC 9110 section 15.1 does not list it). A cache stores it only when the response says so with Cache-Control or Expires.

Example response

HTTP/1.1 417 Expectation Failed
Content-Type: text/plain; charset=utf-8

Expectation Failed

How to send 417

nginx
location /example {
    return 417;
}
Apache (.htaccess)
RewriteEngine On
RewriteRule ^example$ - [R=417,L]
PHP
http_response_code(417);
echo 'Expectation Failed';
exit;
Node.js
res.writeHead(417, { 'Content-Type': 'text/plain' });
res.end('Expectation Failed');
Python (Flask)
# in a view function
return 'Expectation Failed', 417

Change the paths to suit. In nginx, add_header needs always to apply to error responses.

Related codes

All status codes · All 4xx codes

Names and numbers from the IANA HTTP Status Code Registry. Google Search behaviour as documented by Google Search Central.