Expect HTTP request header indicates expectations
that need to be fulfilled by the server in order to properly handle the request.
The only expectation defined in the specification is
to which the server shall respond with:
100if the information contained in the header is sufficient to cause an immediate success,
417(Expectation Failed) if it cannot meet the expectation; or any other 4xx status otherwise.
For example, the server may reject a request if its
No common browsers send the
Expect header, but some other clients such as
cURL do so by default.
|Header type||Request header|
|Forbidden header name||yes|
No other expectations except "100-continue" are specified currently.
- Informs recipients that the client is about to send a (presumably large) message
body in this request and wishes to receive a
100(Continue) interim response.
A client sends a request with a Expect header and waits for the server to respond before sending the message body.
PUT /somewhere/fun HTTP/1.1 Host: origin.example.com Content-Type: video/h264 Content-Length: 1234567890987 Expect: 100-continue
The server now checks the request headers and may respond with a
(Continue) response to instruct the client to go ahead and send the message body, or it
will send a
417 (Expectation Failed) status if any of the expectations
cannot be met.
|Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content (HTTP/1.1)|
BCD tables only load in the browser