Requestly
HTTP InterceptorPricingRequestly vs PostmanBlogDocsDownload

Home / HTTP Headers / Expect

Expect

The HTTP Expect request header specifies expectations that the server must meet to successfully process the entire request.

When a request includes the Expect: 100-continue header, the server responds with a 100 Continue status to indicate readiness to receive the remaining content. This mechanism is useful, especially when the client suspects that the request might fail, such as when sending requests that change server state without prior authenticated verification.

If the server cannot fulfill the expectation, it returns a 417 Expectation Failed response. In other cases, it may respond with different status codes—such as a 4XX code indicating a client error or a 2XX code signaling successful processing without further actions needed.

Most common browsers typically do not send the Expect header. However, some command-line tools and clients do so by default.

Note: The Expect header is part of the HTTP specification and is primarily used to optimize communication between client and server, especially for large or complex requests.

Syntax

Expect: 100-continue

Directives

There is only one defined expectation:

The 100-continue directive 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.

Examples

Large message body

A client sends a request with the Expect header and waits for the server to respond before transmitting the message body. Example of such a request:

PUT /somewhere/fun HTTP/1.1
Host: origin.example.com
Content-Type: video/h264
Content-Length: 1234567890987
Expect: 100-continue

The server examines the headers and responds accordingly. If it sends a 100 Continue status, it indicates that the client should proceed with sending the message body: HTTP/1.1 100 Continue After receiving the continue response, the client completes the request by sending the actual data: [Video data as content for PUT request]

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Expect header. This is especially useful for testing how your application handles expectations that must be met by the server before it processes the request body during development or debugging. Steps to Modify the Expect Header:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. Add a new header modification:
    • Under “Action”, select “Add” or “Override”.
    • In the “Header Name” field, enter Expect.
    • In the “Header Value” field, enter your desired value (e.g., 100-continue).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/\*).
  5. Save the rule.

Once set up, Requestly will inject the Expect: 100-continue header into all matching requests, allowing you to test how your server handles the 100-continue handshake before a large request body is sent.

Set headers visually: intercept and modify HTTP headers without touching your code using Requestly.

Download Free →