Created
March 20, 2013 22:09
-
-
Save djoreilly/5208984 to your computer and use it in GitHub Desktop.
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
import sys | |
import urllib2 | |
req = urllib2.Request('http://127.0.0.1:8080') | |
req.add_header('X-Auth-Token', sys.argv[1]) | |
try: | |
res = urllib2.urlopen(req) | |
print res.read() | |
except urllib2.HTTPError as e: | |
print e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment