2

Is it possible to send a 307 redirect header before receiving the full POST payload?

I've a website which has to redirect a POST request to a third level domain; everything work fine except the fact that when a large file is uploaded it takes nearly twice the time because the 307 is sent only after all POST data as been (uselessly) acquired by the website.

Thanks!

Sandro Paganotti
  • 2,295
  • 16
  • 12
  • I'm going to guess that the answer is 'no', as it looks like it would violate the HTTP spec (see the bottom of this page: [http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html](http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html) and also the section on 'POST' on this page: [http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)). Why does it have to redirect the request at the point of upload? Perhaps this can be solved by changing how the user submits the data? – Michael Schuller Dec 03 '12 at 14:38
  • I've found this post where the answer seems yes, http://stackoverflow.com/questions/2929939/redirecting-before-post-upload-has-been-completed now the question is how this behaviour can be implemented in Apache. – Sandro Paganotti Dec 03 '12 at 15:08
  • I stand corrected. Although it sounds like even though you can do it in theory, it depends on Apache giving you the capability and the client (in this case whatever unique flower of a web browser is being used) handling it as expected. It might be saner to try and approach this from another angle altogether. – Michael Schuller Dec 03 '12 at 19:51
  • Not sure what the preconditions are, but some platform APIs do it the other way around: let users upload directly to that third party/domain and then hit your URL notifying that a file has just been uploaded by the user. – alex Dec 09 '12 at 22:41

0 Answers0