Python requests API using proxy for https request get 407 Proxy Authentication Required

前端 未结 3 918
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-15 11:04

I\'ve been struggling with my company proxy to make an https request.

import requests
from requests.auth import HTTPProxyAuth

proxy_string = \'http://user:         


        
相关标签:
3条回答
  • 2020-12-15 11:40

    Thanks to the amazing help of Lukasa, I solved my issue.

    Please see discussion on fix here : https://github.com/kennethreitz/requests/issues/2911

    or set :

    session.trust_env=False
    
    0 讨论(0)
  • 2020-12-15 11:55

    Other way i have resolved is - speak with your corporate IT administrator and find a direct proxy port which connects to external domain (with / without password)

    pip install --proxy=http://proxyhost:proxy_port pixiedust

    Found from other colleagues using the proxy (proxy_port direct connection) in their eclipse settings (network)

    0 讨论(0)
  • 2020-12-15 11:58

    I personally solved the above problem on my system by updating the environment variables http_proxy,https_proxy,socks_proxy,ftp_proxy.

    First enter the command on your terminal : printenv

    This should show you the environment variables on your system.

    In my case intially: http_proxy=http://proxyserver:port/

    I changed it to : http_proxy=http://username:password@proxy:port/

    using the command export http_proxy="http://username:password@proxy:port/"

    Similarly for https_proxy,socks_proxy,ftp_proxy

    0 讨论(0)
提交回复
热议问题