Python Requests Http Response 406
I have my own domain where an json file is stored (http://example.com/file.json). When accesing the file in browser using the direct link, the json is returned just fine. But when
Solution 1:
Solved by using a different User-Agent. The default Python User-Agent 'python-requests/2.21.0'
was being probably blocked by the hosting company.
r = requests.get(url, headers={"User-Agent": "XY"})
Some of the possible agents: List of User Agent strings
Post a Comment for "Python Requests Http Response 406"