417 Expectation Failed
The server cannot meet the requirement in the Expect header, which in practice always means Expect: 100-continue.
At a glance
- Status code
- 417 Expectation Failed
- Class
- 4xx, client error, the request itself is the problem
- Defined in
- RFC 9110
- Cacheable by default
- no
- Response body
- Optional.
In detail
The client asked for permission before sending a body and the server declined the expectation itself rather than the request.
Servers that do not implement 100-continue should ignore the header, not fail the request. Returning 417 breaks clients that add the header automatically.
Send an empty Expect header to disable the behaviour. In curl that is a header of Expect with nothing after the colon.
Examples
HTTP/1.1 417 Expectation Failed
Content-Length: 0Things that catch people out
- A proxy in the path, not the origin, is often the one rejecting the expectation.
- The failure looks like a large upload breaking intermittently, because clients only add the header above a size threshold.
Try it: HTTP Request Builder
Build a request with any method, headers and body, send it, and read the status line the server returns.
HTTP Request Builder
LOCAL · Browser-OnlyBuild and test HTTP requests with custom headers and body
Authentication
Headers
Generate Code
curl -X GET 'https://api.example.com/endpoint' \
-H 'Content-Type: application/json'Showing a sample URL. Enter your endpoint above to update the snippet.
Related HTTP status codes
All http status codes →100 Continue
The server has read the request headers, is willing to accept the body, and the client should now send it.
400 Bad Request
The server refused the request because it was malformed. The client must change something before retrying, because repeating the same bytes will fail.
411 Length Required
The server refuses the request because it did not include a Content-Length header.
418 I'm a Teapot
A joke code from the Hyper Text Coffee Pot Control Protocol. It is not part of HTTP and should never be returned by a real service.
421 Misdirected Request
The request reached a server that cannot produce a response for the requested authority, usually a connection reuse problem under HTTP/2.
422 Unprocessable Content
The request was well-formed and understood, but the values inside it failed validation. The syntax was fine and the semantics were not.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL