【问题标题】:Proxy with GET request in Python request packagePython 请求包中带有 GET 请求的代理
【发布时间】:2021-06-01 10:47:30
【问题描述】:

我想向代理发出请求 - 但我想使用 GET 请求而不是使用 CONNECT method。 目前我正在使用 Python requests 包。

我在这方面没有经验,所以我不确定是否可以使用另一个 HTTP 库。

我注意到,将tunnel 标志设置为false 时,node.js request package 是可能的。

您还可以通过显式方式发出标准代理 http 请求 设置隧道:false,但请注意,这将允许代理看到 进出目标服务器的流量。

我真的希望这里有人可以帮助我,因为我已经坐了几天这个话题。

【问题讨论】:

    标签: python http proxy python-requests connect


    【解决方案1】:

    您可以使用代理参数。

        proxy = {
        "https": 'https://example'
        "http": 'http://example'
    }
    
    response = requests.get('https://example.com', proxies=proxy)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-24
      • 1970-01-01
      • 2022-01-19
      • 2020-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多