A large upload can waste a transfer when the server can already tell from the request headers that it will reject the request. HTTP offers a pause point for this case. A client sending content can include Expect: 100-continue, then wait for a response before sending the body. The HTTP specification describes this as useful when the content is large or an error is likely.
The exchange
The client sends the request line and headers first. Those headers include Expect: 100-continue and an indication that content will follow. The server examines the method, target, and headers. If these are enough to decide the result, it can send a final response immediately. For example, it may reject a request with 401 Unauthorized or 405 Method Not Allowed before the upload starts. Otherwise, it sends 100 Continue to invite the body. MDN shows this exchange with a file upload.
After 100 Continue, the client sends the body. The server then processes the complete request and sends a final response. 100 Continue means the initial part has been received and has not yet been rejected. It does not promise that the upload will succeed. The specification defines it as an interim response.
Where the pause helps
The early decision can use information available in the headers. A server may know that the method is disallowed or that credentials are missing. It can reject on those grounds before receiving the content. A decision that depends on the body’s contents still has to wait for the body. This is why the pause is most useful when a header-level rejection is plausible.
The saving is conditional. The specification allows a client to start sending the body before a response arrives, and says it should not wait indefinitely. If the response is 417 Expectation Failed, it recommends retrying without the expectation. That response indicates the expectation could not be met along the request path.
What to do
For large uploads, check whether your HTTP client can send Expect: 100-continue and wait briefly before transmitting content. On the server, make decisions available from the method, target, and headers promptly. When those fields settle the result, return the final status. Otherwise, send 100 Continue so the client can proceed. Keep handling the final response separately: the upload still needs to be received and processed.

The Campfire
No commentsNobody has pulled up a log by this one yet. Be the first to say what you make of it.
Held for the desk. It appears after a look.