417
HTTPERRORNotable4xx Client ErrorHIGH confidence
Expectation Failed
Production Risk
Low. This is part of the standard flow control of HTTP. A compliant client should be able to handle this rejection by sending the request again without the 'Expect' header.
What this means
The expectation given in the 'Expect' request header field could not be met by the server. This is most commonly seen with the '100-continue' expectation.
Why it happens
- 1A client sends 'Expect: 100-continue' but the server is not configured to handle it or has already decided to reject the request.
- 2A proxy or intermediary server does not understand the 'Expect' header and cannot forward it properly.
- 3The server cannot fulfill the expectation for other reasons, such as authentication failure.
How to reproduce
A client sends an 'Expect: 100-continue' header before uploading a large file, but the server immediately rejects the request based on the headers (e.g., due to invalid authentication).
trigger — this will error
trigger — this will error
POST /upload HTTP/1.1 Host: example.com Authorization: Bearer invalid-token Expect: 100-continue
expected output
HTTP/1.1 417 Expectation Failed
Fix
Remove the 'Expect' Header
WHEN The server does not support it.
Remove the 'Expect' Header
The client should simply send the request with the body directly, without the 'Expect' header.
Why this works
Client-Side Correction
Sources
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev