Skip to content

Instantly share code, notes, and snippets.

@djoreilly
Created March 20, 2013 22:09
Show Gist options
  • Save djoreilly/5208984 to your computer and use it in GitHub Desktop.
Save djoreilly/5208984 to your computer and use it in GitHub Desktop.
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