gpt4 book ai didi

python - 如何使用 python 的 httplib2 自动禁用重定向后的功能?

转载 作者:行者123 更新时间:2023-11-28 22:52:27 25 4
gpt4 key购买 nike

当我向某个站点发出 GET 请求时,我想禁用 httplib2 跟随重定向。这可能吗?

最佳答案

在您的 Http 对象上禁用重定向:

import httplib2

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

关于python - 如何使用 python 的 httplib2 自动禁用重定向后的功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20411126/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com