# HTTP 417 Expectation Failed — Meaning, Causes & Fixes

> 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.

- Class: 4xx Client Error
- Retry: No — change the request first
- Cacheable by default: no
- Defined in: [RFC 9110 §15.5.18 — 417 Expectation Failed](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.18)

## Example response

```http
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;
```

## FAQ

### 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

- [100 Continue](https://www.devkult.com/http/100.md)
- [400 Bad Request](https://www.devkult.com/http/400.md)
- [411 Length Required](https://www.devkult.com/http/411.md)

Open the interactive page: https://www.devkult.com/http/417