devkult_
tools29converters34

417 Expectation Failed

4xx client error

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

417 is the 'no' to an Expect header. In practice the only expectation in use is Expect: 100-continue, and some servers and proxies that don't support it answer 417 instead of ignoring it.

Class4xx Client Error
Retry?No — change the request first
Cacheable by defaultNo — only with explicit Cache-Control
Response bodyAllowed
Defined inRFC 9110 §15.5.18 — 417 Expectation Failed
Example response
HTTP/1.1 417 Expectation Failed
Content-Type: application/json
Content-Length: 30

{"error":"Expectation Failed"}

Common causes

  • A client sent Expect: 100-continue to a server or proxy that rejects it.
  • Older .NET HttpWebRequest clients send that header by default.

How to fix it

  1. Disable the header: curl -H 'Expect:', or ServicePointManager.Expect100Continue = false in older .NET.
  2. Upgrade the proxy or server to one that handles 100-continue.

Send a 417 from your server

Express
res.status(417).json({ error: "Expectation Failed" });
Next.js route handler
return Response.json({ error: "Expectation Failed" }, { status: 417 });
Flask
return {"error": "Expectation Failed"}, 417
Go net/http
http.Error(w, "Expectation Failed", http.StatusExpectationFailed)
nginx
return 417;

Check what a URL returns

Print just the status line from the command line, or check a whole list of URLs at once, with their response headers, in the HTTP Status Checker.

curl -sI https://example.com/your-path | head -n 1

Frequently asked questions

How do I stop curl sending Expect: 100-continue?

Pass an empty header: curl -H 'Expect:' …. curl only adds it for large bodies, so small requests aren't affected.

Related status codes