-
Notifications
You must be signed in to change notification settings - Fork 0
HTTP 1xx Informational
The initial part of a request has been received and has not yet been rejected by the server. The server intends to send a final response after the request has been fully received and acted upon.
Typically a request-response sequence is straightforward. One single request is made, received, and responded to.
But sometimes a request needs to be broken up into parts. This might occur if the request is too big. It might occur if the requester needs to check if the header is formatted properly, or if the server is actually ready to receive the request.
In these cases, the client (browser) might send the initial request with a header that includes Expect: 100-continue
When that occurs, the server will receive the initial request and — if everything is okay — respond with the 100: Continue status. This signals the client to complete the request.
-
When Expect: 100-Continue is NOT present, HTTP follows approximately the following flow (from the client's point of view):
- The request initiates a TCP connection to the server.
- When the connection to the server is established, the full request--which includes both the request headers and the request body--is transmitted to the server.
- The client waits for a response from the server (comprised of response headers and a response body).
- If HTTP keep-alives are supported, the request is optionally repeated from step 2.
-
When the client is using the Expect: 100-Continue feature, the following events occur:
- The request initiates a TCP connection to the server.
- When the connection to the server is established, the request--including the headers, the Expect: 100-Continue header, without the request body--is then transmitted to the server.
- The client then waits for a response from the server.
- If the status code is a final status code, using the prior steps above the client retries the request without Expect: 100-Continue header.
- If the status code is 100-Continue, the request body is sent to the server.
- The client will then wait for a response from the server (comprised of response headers and a response body).
- If HTTP keep-alives are supported, the request is optionally repeated from step 2.
You're sending a large object to the server using a PUT request, you may include a Except header like this
PUT /media/file.mp4 HTTP/1.1
Host: api.example.org
Content-Length: 1073741824
Except: 100-continue
This tells the server that it should with a 100 Continue Status Code if the server is going to be able to accept the request
HTTP/1.1 Continue
When the client receives this, it tells the client the server will accept the request, and it may start sending the request body
The server understands and is willing to comply with the client's request, via the Upgrade header field1, for a change in the application protocol being used on this connection