Python 将代理与session.post()一起使用时,获取错误getaddrinfo失败

Python 将代理与session.post()一起使用时,获取错误getaddrinfo失败,python,python-3.x,post,proxy,python-requests,Python,Python 3.x,Post,Proxy,Python Requests,使用会话进行调用时代理不工作。post()获取错误[11002]getaddrinfo失败。但是,通过session.get()代理也可以从浏览器访问同一站点。我检查了多个StackOverflow答案,但都为session.get()进行了解释。 我是错过了什么还是做错了?请帮帮我,这很关键,是个拦路虎 以下是伪代码: def test(URL, login_url, data): session = requests.Session() proxies = {"ht

使用会话进行调用时代理不工作。post()获取错误[11002]getaddrinfo失败。但是,通过session.get()代理也可以从浏览器访问同一站点。我检查了多个StackOverflow答案,但都为session.get()进行了解释。 我是错过了什么还是做错了?请帮帮我,这很关键,是个拦路虎

以下是伪代码:

def test(URL, login_url, data):
    session = requests.Session()
    proxies = {"https": "http://username:password@10.28.248.100:80"}
    session.proxies = proxies
    s = session.post(url=login_url, data=data, headers={'User-Agent': 'Mozilla/5.0',
                                                 'Content-Type': 'application/x-www-form-urlencoded'})
    print(s.cookies)
    #s = session.get(url=url, headers={'User-Agent': 'Mozilla/5.0'})
    print(s.headers)```