Python 3.51请求导致代理错误

Python 3.51请求导致代理错误,python,proxy,python-requests,Python,Proxy,Python Requests,我试图使用Python(3.51)请求(请求包版本为2.10.0)使用Informatica Cloud REST API: 在我本地的机器上,所有的工作都非常出色。但是,在我的测试服务器上,我得到以下错误: HTTPSConnectionPool(host='app.informaticaodemand.com',port=443):url:/ma/api/v2/user/login超过最大重试次数(由ProxyError('无法连接到代理')引起),NewConnectionError(':

我试图使用Python(3.51)请求(请求包版本为2.10.0)使用Informatica Cloud REST API:

在我本地的机器上,所有的工作都非常出色。但是,在我的测试服务器上,我得到以下错误:

HTTPSConnectionPool(host='app.informaticaodemand.com',port=443):url:/ma/api/v2/user/login超过最大重试次数(由ProxyError('无法连接到代理')引起),NewConnectionError(':无法建立新连接:[WinError 10060]连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机未能响应',))

令人烦恼的是,curl在服务器上运行良好:

curl -H "Content -Type: application/json" -X POST --data @Login.txt   https://app.informaticaondemand.com/ma/api/v2/user/login -k
其中login.txt具有:

{“@type”:“login”,“username”:“myuser”,“password”:“mypassword”}

如果我不使用-k开关,我会得到:

curl:(60)SSL证书问题,请验证CA证书是否正常。详细信息:错误:14090086:SSLroutines:SSL3\u获取\u服务器\u证书:证书验证失败 详情如下:

使用-k开关一切正常

在执行Python.exe之前,我尝试通过环境变量设置代理:

set HTTP_PROXY=10.123.123.10:8080
set HTTPS_PROXY=10.123.123.10:8080
但结果是一样的


有没有关于下一步尝试的想法?

可以尝试以下方法:

import requests

proxies = {
  'http': 'http://10.123.123.10:8080',
  'https': '10.123.123.10:8080',
}

response = requests.post('https://app.informaticaondemand.com/ma/api/v2/user/login', headers=genheaders, data=data, proxies=proxies)
链接到请求代理文档:

import requests

proxies = {
  'http': 'http://10.123.123.10:8080',
  'https': '10.123.123.10:8080',
}

response = requests.post('https://app.informaticaondemand.com/ma/api/v2/user/login', headers=genheaders, data=data, proxies=proxies)