I'm surprised that redirect would work on POST. The RFC http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html says:
If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. It not only says "MUST NOT" but it says it in CAPITAL LETTERS :) On Jan 23, 2012, at 11:33 AM, Brandon Wirtz wrote: > You can’t sleep, it won’t work. Post should work in most modern browsers > they will forward post data. Works in IE and chrome. > > > > From: [email protected] > [mailto:[email protected]] On Behalf Of Joshua Smith > Sent: Monday, January 23, 2012 4:42 AM > To: [email protected] > Subject: Re: [google-appengine] Hide Dead Line Exceeded Errors from User > (Python) > > Cute. Won't work for a POST, though. Also, I wonder if a short sleep might be > in order. Another variation would be to check how much wallclock time has > passed, and if it's not a lot, just return get(self) (which would work for > POST). > > On Jan 23, 2012, at 6:05 AM, Brandon Wirtz wrote: > > > You Just Died a Horrible death your app timed out, the world is ending around > you. Deal with it. No, seriously, handle the exception and try it again it > will work eventually. > > Here is the code. > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > from google.appengine.runtime import DeadlineExceededError > > class MainPage(webapp.RequestHandler): > def get(self): > try: > # Do stuff... > > except DeadlineExceededError: > self.response.clear() > self.response.headers['Location'] = response.geturl() > self.response.set_status(302) > > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > Feel free to send Dancing Girls, Mermaids, Mountain Dew, or whatever else if > this makes all your DEE issues go away. We are testing this for keeping free > apps free. Server might get slow, but pages will always load. (unless you get > 7 302’s then most browsers give up.) > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
