简体   繁体   中英

How can I disable automatically following redirects using python's httplib2?

I would like to disable httplib2 from following redirects when I make a GET request to some site. Is this possible?

Disable redirects on your Http object:

import httplib2

http = httplib2.Http()
http.follow_redirects = False

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM