简体   繁体   English

如何使用python的httplib2禁用自动重定向。

[英]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. 当我向某个站点发出GET请求时,我想禁止httplib2跟随重定向。 Is this possible? 这可能吗?

Disable redirects on your Http object: 在您的Http对象上禁用重定向:

import httplib2

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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