HTTP 417 Expectation Failed
HTTP 417 Expectation Failed means the server cannot meet the requirements stated in the Expect request header. In practice, 417 is almost exclusively related to the Expect: 100-continue mechanism, which is used by HTTP clients to check if the server will accept a large request body before sending it.
Quick reference
| Code | 417 |
|---|---|
| Name | Expectation Failed |
| Category | 4xx Client Errors |
| Specification | RFC 9110 §15.5.18 |
| IANA status | Assigned |
| Cacheable | No |
| Client action | Remove or adjust the Expect header. Do not include Expect: 100-continue if the server does not support it. |
| In-depth guide | HTTP 417 full guide → |
What HTTP 417 means
RFC 9110 defines 417 as indicating that the expectation given in the request's Expect header field could not be met by at least one of the inbound servers. The only standardized value for the Expect header is 100-continue, so 417 is almost always about that mechanism.
The Expect: 100-continue mechanism works like this: a client that wants to send a large request body first sends the request headers with Expect: 100-continue, then waits. If the server is willing to receive the body, it responds with 100 Continue, and the client sends the body. If the server will reject the request (wrong auth, wrong content type, size limit), it returns the error code immediately — 401, 413, 417 — and the client does not waste time uploading a body that will be rejected.
When 417 occurs
Server does not support Expect: 100-continue
Older or simpler HTTP servers and some proxies do not implement the 100-continue mechanism. When they receive an Expect: 100-continue header, they return 417 to indicate they cannot fulfill the expectation.
Expect header with unrecognized value
If a client sends a custom Expect value that the server does not recognize — anything other than 100-continue — the server returns 417. The RFC only defines 100-continue as a valid value.
Proxy that does not forward Expect headers
Some proxies strip the Expect header before forwarding the request. The origin server never sees it and does not send 100, leaving the client waiting. The proxy itself may return 417 if it is the one enforcing the Expect check.
How to fix a 417
- Remove the Expect header. If the server does not support 100-continue, send the request body without waiting for a 100 response. Most HTTP client libraries have an option to disable the Expect header.
- In curl:
curl -H "Expect:" ...sends an empty Expect header which disables the 100-continue mechanism. - In Python requests: The library disables Expect: 100-continue by default, so this is rarely an issue in Python HTTP clients.
- Check proxy configuration. If a proxy is between the client and server, confirm whether it strips or respects Expect headers.
FAQ
What does HTTP 417 Expectation Failed mean?
HTTP 417 means the server cannot fulfill the requirement specified in the Expect request header — almost always Expect: 100-continue. Remove the Expect header to send the request without the 100-continue handshake.
Why is 417 so rare?
Most modern servers support Expect: 100-continue or ignore the header gracefully. 417 appears mainly when using older servers, some proxies, or misconfigured infrastructure.
How do I disable Expect: 100-continue?
In curl: curl -H "Expect:" <url>. Most HTTP libraries allow disabling it in client configuration. Check your library's documentation for the option name.
Is 417 a client or server error?
It is a 4xx code, indicating the request cannot be fulfilled as submitted. But the root cause is usually a server-side limitation (no Expect support), not a client bug. The fix is typically on the client side (remove Expect header) even though the limitation is the server's.
Related resources
On this site: HTTP 417 Expectation Failed — full guide · HTTP 100 Continue · HTTP 413 Content Too Large · All 4xx client errors
Standards: RFC 9110 §15.5.18 · IANA HTTP Status Code Registry · MDN Web Docs: 417