Skip to content

Instantly share code, notes, and snippets.

@sc68cal
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sc68cal/4117f6702352221710f2 to your computer and use it in GitHub Desktop.
Save sc68cal/4117f6702352221710f2 to your computer and use it in GitHub Desktop.
>>> API_ENDPOINT
'https://api.phila.gov/bike-share-stations/v1'
>>> r = requests.get(url=API_ENDPOINT)
>>> r.ok
False
>>> r.content
'<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body bgcolor="white">\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'
>>> r = requests.get(API_ENDPOINT, headers={'User-Agent': 'curl/7.37.1'})
>>> r.ok
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment