Error Codes Wiki

HTTP 417 Expectation Failed — Expect Header Rejected

Informational4xx client error

Overview

HTTP 417 Expectation Failed means the server cannot meet the requirements indicated by the Expect request header, commonly Expect: 100-continue.

Key Details

  • Most commonly triggered by the Expect: 100-continue header
  • Client sends Expect: 100-continue to check if server will accept the body before sending it
  • If the server returns 417, the client should resend without the Expect header
  • Some older HTTP/1.0 proxies do not understand the Expect header
  • curl automatically sends Expect: 100-continue for POST bodies larger than 1024 bytes

Common Causes

  • Server or proxy does not support Expect: 100-continue mechanism
  • HTTP/1.0 proxy in the chain stripping or rejecting Expect header
  • Misconfigured reverse proxy not forwarding Expect headers properly
  • Server explicitly rejecting the expectation before body is sent

Steps

  1. 1Remove the Expect header from your request and retry
  2. 2In curl, disable it with: curl -H 'Expect:' (empty value) your-url
  3. 3In PHP curl: curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  4. 4Check if an intermediary proxy is causing the issue by testing directly against origin
  5. 5Update HTTP client library as newer versions handle Expect negotiation better

Tags

http417expectation-failedexpect-header100-continue

More in 4xx Client Error

Frequently Asked Questions

The client asks the server if it will accept the request body before actually sending it, saving bandwidth if the server would reject it.