How to stop going to redirected URL in Google App Engine with Python?

Posted by user1762586 on Stack Overflow See other posts from Stack Overflow or by user1762586
Published on 2012-10-21T04:52:58Z Indexed on 2012/10/21 5:00 UTC
Read the original article Hit count: 142

I'm using urlfetch from google app engine, but it keeps going to the redirected final page even though I use:

result = urlfetch.fetch(classUrl, payload=None, method=urlfetch.GET, headers={}, allow_truncated=False, follow_redirects=False)

E.g. if classUrl was a searched term in Google

(https://www.google.com/search?q=setInstanceFollowRedirects()+python&oq=setInstanceFollowRedirects()+python&sugexp=chrome,mod=0&sourceid=chrome&ie=UTF-8)

it would redirect me to www.google.com

How do I stop this redirection? Thanks!

© Stack Overflow or respective owner

Related posts about python

Related posts about google-app-engine