Albert Albert - 19 days ago 9
Python Question

Google App Engine self.redirect() POST method

In GAE (Python), using the webApp Framework, calling self.redirect('some_url') redirects the user to that URL via the GET method. Is it possible to do a (redirect) via the POST method with some parameters as well?

If possible, how?

Thanks!

Answer

This is not possible due to how most clients implement redirection [1]:

However, most existing user agent implementations treat 302 as if it were a 303 response, performing a GET on the Location field-value regardless of the original request method.

So you must use a workaround (like simply calling the method post() from the RequestHandler) or forget the idea.

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2

Comments