Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. Headers
  5. Expect

Expect header

The HTTPExpectrequest header indicates that there are expectations that need to be met by the server in order to handle the complete request successfully.

When a request has anExpect: 100-continue header, a server sends a100 Continue response to indicate that the server is ready or capable of receiving the rest of the request content.Waiting for a100 response can be helpful if a client anticipates that an error is likely, for example, when sending state-changing operations without previously verified authentication credentials.

A417 Expectation Failed response is returned if the server cannot meet the expectation, or any other status otherwise (e.g., a4XX status for a client error, or a2XX status if the request can be resolved successfully without further processing).

None of the more common browsers send theExpect header, but some clients (command-line tools) do so by default.

Header typeRequest header
Forbidden request headerYes

Syntax

http
Expect: 100-continue

Directives

There is only one defined expectation:

100-continue

Informs recipients that the client is about to send a (presumably large) message body in this request and wishes to receive a100 Continue interim response.

Examples

Large message body

A client sends a request withExpect header and waits for the server to respond before sending the message body.

http
PUT /somewhere/fun HTTP/1.1Host: origin.example.comContent-Type: video/h264Content-Length: 1234567890987Expect: 100-continue

The server checks the headers and generates the response, where a100 Continue instructs the client to send the message body:

http
HTTP/1.1 100 Continue

The client completes the request by sending the actual data:

http
[Video data as content for PUT request]

Specifications

Specification
HTTP Semantics
# field.expect

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp