HTTPfy

417 Expectation Failed

The server cannot meet the requirement in the request's Expect header.

417 at a glance

Code
417
Name
Expectation Failed
Class
4xx Client error
Status
IANA-registered standard code
Defined in
RFC 9110, Section 15.5.18
Cacheable by default
No by default. Caches store it only when the response carries explicit freshness (Cache-Control max-age, s-maxage or Expires).

What 417 means

417 Expectation Failed means the server (or a proxy on the way) does not support an expectation in the Expect header. In practice the only defined expectation is 100-continue, so a 417 means "do not wait for 100, just send the body".

What typically causes a 417

  • Old proxies and some IIS or Lighttpd setups rejecting Expect: 100-continue.
  • .NET HttpClient and curl uploads that add Expect automatically.

Fix it on the server

  • Support 100-continue, or ignore the Expect header rather than failing.

Fix it as a client or visitor

  • Retry without the header: curl -H "Expect:"; .NET ServicePointManager.Expect100Continue = false or request.Headers.ExpectContinue = false.

Headers that go with 417

HeaderRole
ExpectThe request header that was rejected.

Example response

HTTP/1.1 417 Expectation Failed
Connection: close
Content-Length: 0

Opens the HTTP headers tool with your URL filled in; it shows the status line and headers of every redirect hop.