Skip to content

Instantly share code, notes, and snippets.

@notmyname
Created May 31, 2012 02:36
Show Gist options
  • Save notmyname/2840588 to your computer and use it in GitHub Desktop.
Save notmyname/2840588 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import httplib
host = sys.argv[1]
path = sys.argv[2]
auth_token = sys.argv[3]
conn = httplib.HTTPConnection(host)
headers = {'X-Auth-Token': auth_token}
conn.request('HEAD', path, None, headers)
resp = conn.getresponse()
print resp.status
print resp.getheaders()
print repr(resp.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment