Open In App

HTTP headers | Expect

Improve
Improve
Like Article
Like
Save
Share
Report

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.

Syntax:

Expect: 100-continue

Directives:

  • 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.

Example:

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.


Last Updated : 18 Oct, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads