Continue
Production Risk
Low. This is a standard part of HTTP flow control and is typically handled transparently by HTTP clients and servers without issue.
This interim response indicates that the client should continue the request or ignore the response if the request is already finished. The server has received the request headers and the client should proceed to send the request body.
- 1Client sends a request with an 'Expect: 100-continue' header to check if the server will accept the request before sending a large body.
- 2The server evaluates the initial request headers and determines it is willing to accept the request body.
- 3This mechanism is an optimization to avoid sending large amounts of data that the server would ultimately reject.
A client uploads a large video file and uses the 'Expect: 100-continue' header to ensure the server is ready to accept it.
POST /uploads HTTP/1.1 Host: example.com Content-Type: video/mp4 Content-Length: 104857600 Expect: 100-continue
expected output
HTTP/1.1 100 Continue
Fix
Send the request body after receiving 100 Continue
// Using the Fetch API with an Expect header (Node.js / undici)
const response = await fetch('https://api.example.com/uploads', {
method: 'POST',
headers: {
'Content-Type': 'video/mp4',
'Content-Length': String(fileBuffer.byteLength),
'Expect': '100-continue',
},
body: fileBuffer,
});
// The HTTP client library automatically waits for the 100 before
// streaming the body. No special handling needed in application code.Why this works
The 100 Continue interim response tells the client the server accepted the request headers and is ready for the body. Most HTTP client libraries handle this transparently: they pause after sending headers with 'Expect: 100-continue', wait for the interim response, then send the body. Application code only needs to ensure the Expect header is set on large uploads to avoid wasting bandwidth on a request the server would reject.
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev