What Is a 100 Status Code?
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.
When the request contains an Expect header field that includes a 100-continue expectation, the 100 response indicates that the server wishes to receive the request payload body1. The client ought to continue sending the request and discard the 100 response.
If the request did not contain an Expect header field containing the 100-continue expectation, the client can simply discard this interim response.
100 CODE REFERENCES
Rails HTTP Status Symbol
Go HTTP Status Constant
Symfony HTTP Status Constant
Python2 HTTP Status Constant
Python3+ HTTP Status Constant
Python3.5+ HTTP Status Constant
Apache HttpComponents Core
How does the 100 status code work?
When a client sends a request, it expects a response from the server.
If the server needs additional information before processing the request, it sends a 100 status code. The client then sends the remainder of the request. Once the server receives the request, the server processes the request and sends another response code. This response code indicates a success or failure.
You can think of the 100 continue status code like a game of catch. As you (the client) prepare to throw the ball (the request), your friend (the server) asks you to wait a minute. After your friend gets their mitt on, they give you the go-ahead to throw the ball.
What is an example of a 100 continue status code?
Here is an example of a 100 continue status code:
The client requests to upload a large image file:
POST /upload HTTP/1.1
The server responds with a 100 continue status code:
HTTP/1.1 100 Continue
The client proceeds with sending the file:
POST /upload HTTP/1.1
The server responds with a 200 status code — the upload is a success:
HTTP/1.1 200 OK
5 best practices for using 100 continue status codes
For the best results with 100 continue status codes, follow these best practices:
1. Use the 100 status code only when necessary
Use the 100 status code when the server needs more information before it can process a request. If the server can immediately process the request without additional information, skip using a 100 status code.
2. Respond with a 100 status code immediately
If the server needs more information before processing a request, it should send a 100 status code right away to let the client know: (1.) It’s received the initial request and (2.) Is waiting for more information.
3. Use the appropriate headers
The server should include appropriate headers in the 100 status code response to share what additional information it needs and how the client should send it.
4. Avoid sending multiple 100 responses for the same request
If the server has already sent a 100 response for a request, it should not send another 100 response for the same request. The only time a server should send an additional response for the same request is when it needs information that wasn’t included in the previous request.
5. Include a final status code to indicate success or failure
The 100 status code is a temporary response — it indicates the server needs more information before it can process the request. Once the server has received the entire request and processed it, it should send a final status code to share whether the request was a success or failure.
Help! My final status code following a 100 status code failed.
A final status code can fail for multiple reasons, including:
- Client authorization
- Requested resource location
- Processing error
- And more
You can troubleshoot this final status code by:
- Reviewing your request’s formatting
- Confirming the requested resource exists on the server
- Checking the client has access to the resource
- Learn about web development
- Learn about SEO
- Web development services from WebFX
- SEO services from WebFX
- MDN Web Docs
- Ecommerce Web Development
- HTTP Status Codes Glossary
- VPS Hosting: What is It and What Does It Mean for Your Company?
- Web Development Glossary
- What is a 101 Status Code?
- What is a 102 Status Code?
- What is a 200 Status Code?
- What is a 201 Status Code?
- What is a 202 Status Code?
- What is a 208 Status Code?