[Twisted-Python] Twisted web, giant-file POST forwarding and early bail-out.

Itamar Turner-Trauring itamar at itamarst.org
Tue Jul 9 05:30:06 MDT 2013


On 07/09/2013 04:04 AM, Rob Meijer wrote:
> 3) When the token does not check out, or the connection to the server
> fails, it remains a mystery to me how I should throw an error in such a
> way that it allows me to send a proper error message to the client, while
> not having to first accept the whole large file. That is, it seems rather
> silly that I would know things failed after the first POST body chunk, but
> would have to wait for and accept hundreds of megabytes or maybe even a
> few gigabytes of post data before I can notify the client that something
> went wrong.
>
HTTP clients can send a "Expects: 100-continue" header (or something 
like that), which tells the server it should give an early rejection or 
acceptance before the client sends the data, in *addition* to the final 
response. You would still need to write some code to support this, but 
it is possible.



More information about the Twisted-Python mailing list