417

Expectation Failed

Overview

417 Expectation Failed means the server cannot meet the expectation set in the request's Expect header — most commonly Expect: 100-continue. A client sends 100-continue to check whether the server will accept a large body before actually uploading it.

If the server or an intermediate proxy does not understand this mechanism, it returns 417 instead of 100 Continue. It is usually fixed by dropping the Expect header and just sending the body.

When it happens

Request / Response example

Request
POST /large-upload HTTP/1.1
Host: api.example.com
Expect: 100-continue
Content-Length: 10485760
Response
HTTP/1.1 417 Expectation Failed
Content-Type: text/plain

Expectation given in Expect header could not be met.

In code

# Some proxies choke on 100-continue; send an empty Expect to skip it
curl -X POST --data-binary @big.bin \
  -H 'Expect:' \
  https://api.example.com/large-upload
> POST /large-upload HTTP/1.1
> Expect: 100-continue
>
< HTTP/1.1 100 Continue      (server OK -> client sends body)
< HTTP/1.1 417 Expectation Failed   (server refuses the expectation)

Common causes

How to fix

Notes

Related status codes

Related headers

Expect

Specification