0

Im trying to reach isiscouch on my app on pythonanywhere and despite the fact that the site is whitelisted and that I'm currently a free user it just returns HTTPError: (403, 'Forbidden') on error log. What am I missing here?

response, content = httplib2.Http().request("https://-stripped-.iriscouch.com", 'GET', None, headers)
JeanPaulDepraz
  • 625
  • 7
  • 12

1 Answers1

1

You're probably getting the 403 from the site, then. What is in the content of the response?

Glenn
  • 7,262
  • 1
  • 17
  • 23
  • Thats the stacktrace: File "/usr/local/lib/python2.7/dist-packages/httplib2/socks.py", line 390, in __negotiatehttpraise HTTPError((statuscode, statusline[2])) HTTPError: (403, 'Forbidden') ` – JeanPaulDepraz Mar 10 '15 at 13:50
  • I`ve reached the website trough website bash using curl and got the data back, but when tried the same on a pyhon console using httplib2 I got the 403. – JeanPaulDepraz Mar 10 '15 at 13:57
  • I made a new test `httplib2.Http().request("http://biopython.org", 'GET')` wich is another whitelisted url and tested on curl and still got 403. Do you suggest another lib to use or it is just a problem my account on pythonanywhere is facing? – JeanPaulDepraz Mar 10 '15 at 15:02
  • 1
    This might be a bug in `httplib2`, I remember it used to have problems with HTTPS over proxies. (PythonAnywhere uses a proxy for the free user whitelist thing.) You might have more luck if you use `requests` instead, it doesn't have that bug. – Giles Thomas Mar 11 '15 at 14:10