The current approach is not very sound since it only contemplates the "happy path". Failed requests such as 4XX and 5XX should be returned immediately when trying to do a chunked request.
Using the header Expect: 100-continue forces the server to send an initial 100 (Continue) status when the request is successful and an additional final status when the request body is fully sent (HTTP Specs). We can return the initial 100 to the user and the final status when all the body chunks are sent.
The current approach is not very sound since it only contemplates the "happy path". Failed requests such as
4XXand5XXshould be returned immediately when trying to do a chunked request.Using the header
Expect: 100-continueforces the server to send an initial100 (Continue)status when the request is successful and an additional final status when the request body is fully sent (HTTP Specs). We can return the initial100to the user and the final status when all the body chunks are sent.