The HTTP headers Expect request-header field is used to indicate specific behaviors or expectations that the server needs to fulfill in order to respond to the client. Generally, Expect: 100-continue is the only expectation defined for the header field. If the data provided in the header field meets the expectation value, then the server responds with 100 indicating that it is a success, else it responds with status 417 specifying that the expectation has failed. The reason behind putting the Expect, that would be to work around broken web servers.
- 100-continue: It means that the server has received the request header and in order to send the request body, the server must respond with status 100 to the client.
Note: There is no need to put a blank header if you are not going to put any Expect clause.
PUT /demo/program HTTP/1.1 Host: original.sample.com Content-Type: video/h264 Content-Length: 2342564178765 Expect: 100-continue
The server now goes through the request headers and either responds with 100 indicating the client to send the request body or return status 417 if the expectations are not met.
Supported Browsers: The browsers compatibility for HTTP headers Expect is unknown right now.
- HTTP headers | Expect-CT
- HTTP headers | Access-Control-Expose-Headers
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | Via
- HTTP headers | Allow
- HTTP headers | Age
- HTTP headers | Set-Cookie2
- HTTP headers | Retry-After
- HTTP headers | Origin
- HTTP headers | Accept
- HTTP headers | Trailer
- HTTP headers | Connection
- HTTP headers | X-Forwarded-For
- HTTP headers | If-None-Match
- HTTP headers | X-XSS-Protection
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.