417

개요

417 Expectation Failed는 요청의 Expect 헤더에 담긴 기대(가장 흔하게는 Expect: 100-continue)를 서버가 충족할 수 없다는 뜻입니다. 클라이언트는 큰 본문을 보내기 전에 서버가 받아줄지 미리 확인하려고 Expect: 100-continue를 보냅니다.

서버나 중간 프록시가 이 메커니즘을 이해하지 못하면 100 Continue 대신 417을 반환합니다. 대부분 Expect 헤더를 제거하고 그냥 본문을 전송하면 해결됩니다.

언제 발생하나

요청 / 응답 예시

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

Expectation given in Expect header could not be met.

코드로 보기

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

흔한 원인

해결 방법

실무 참고

관련 상태코드

관련 헤더

Expect

스펙 근거