I am trying to fetch a JSON response from http://erdos.sdslabs.co/users/shagun.json. Using browser/Python\'s Requests library leads to an authentication error, but curl seems t
In case you have a proxy configured at your environment, define it at your session/request as well.
For example with session:
my_proxies = {
'http': 'http://myproxy:8080',
'https': 'https://myproxy:8080'
}
session = requests.Session()
request = requests.Request('POST', 'http://my.domain.com', data=params_template, headers=req_headers, proxies=my_proxies)
prepped = session.prepare_request(request)
response = session.send(prepped)
see documentation:
request http://docs.python-requests.org/en/master/user/quickstart/
session http://docs.python-requests.org/en/master/user/advanced/