[google-appengine] Re: How to get url from fetchurl?
> I want to know actual url, where i'm via fetchurl. Something like > geturl in urllib2. > > for example if i've follow_redirects=True, then i want to know which > url is the ending one. > The corresponding issue 404 [1] is fixed however I don't see how we can retrieve the final URL. The headers property of the Response object that urlfetch.fetch() returns doesn't have it. Should the issue 404 be re-opened? [1] http://code.google.com/p/googleappengine/issues/detail?id=404 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How to get url from fetchurl?
You can follow redirects manually like so: response = urlfetch.fetch(url, allow_truncated=True, follow_redirects=False) if 'Location' in response.headers: url = response.headers.get('Location') response = urlfetch.fetch(url, allow_truncated=True) You could also loop this to follow more than one redirect. On Jan 17, 10:18 am, ehmo wrote: > I want to know actual url, where i'm via fetchurl. Something like > geturl in urllib2. > > for example if i've follow_redirects=True, then i want to know which > url is the ending one. > > any idea? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---