Created
May 18, 2016 00:07
-
-
Save armandofox/a8899d74a4db63019f075dd8a7738a34 to your computer and use it in GitHub Desktop.
HTTP API GET in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
self.body = urllib2.urlopen(url).read() | |
except urllib2.URLError: | |
self.error = 'The BART website did not respond' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment