-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Hi!
I've found that requests behaves quite weirdly when using a proxy with HTTPS endpoints.
It doesn't change if the proxy is specified using environment variables or using the proxies attribute.
Without proxy
import requests
rs = requests.session()
res = rs.request("get",
"https://api.bitbucket.org/1.0/repositories/tutorials/tutorials.bitbucket.org")
print res.text
>> u'{\n "scm": "hg",
...
"/1.0/repositories/tutorials/tutorials.bitbucket.org"\n}'
Using a proxy
import requests
rs = requests.session()
proxies = { 'https': "http://localhost:3128" }
res = rs.request("get",
"https://api.bitbucket.org/1.0/repositories/tutorials/tutorials.bitbucket.org",
proxies=proxies)
print res.text
>> u'<HTML></HTML>\r\n'
Note 1: that proxy uses a CNTML authentication
Note 2: it works with HTTP endpoints
Metadata
Metadata
Assignees
Labels
No labels