Forums

Proxy Error When Using Requests

Hi -- I am trying to access the jsonOdds API and getting proxy error Forbidden.

The odd thing is that when running the code on my local server it works totally fine which leads me to believe it is an error accessing it just through Python Anywhere. Any suggestions?

File "/home/brendanbernstein/.virtualenvs/socialbetting/local/lib/python3.5/site-packages/requests/adapters.py", line 417, in send
    timeout=timeout
  File "/home/brendanbernstein/.virtualenvs/socialbetting/local/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 640, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/brendanbernstein/.virtualenvs/socialbetting/local/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 287, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='jsonodds.com', port=443): Max retries exceeded with url: /api/results/a98f15bd-cdbf-4ed1-85a9-274a32f82bcb (Caused by ProxyError('Ca    nnot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))

[edit by admin: formatting]

Realized it's because I need to get this whitelisted. Can you please add jsonodds? (https://jsonodds.com/)

Added jsonodds.com to the whitelist.