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

Glyph glyph at twistedmatrix.com
Wed Jul 10 14:49:56 MDT 2013


On Jul 9, 2013, at 4:30 AM, Itamar Turner-Trauring <itamar at itamarst.org> wrote:

> 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.

FYI, it's "Expect: 100-continue" ;-). <http://www.w3.org/Protocols/rfc2616/rfc2616-sec8>.

-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130710/fab272ca/attachment.html>


More information about the Twisted-Python mailing list