Skip to content

Instantly share code, notes, and snippets.

@anandology
Created July 3, 2012 12:41
Show Gist options
  • Select an option

  • Save anandology/3039510 to your computer and use it in GitHub Desktop.

Select an option

Save anandology/3039510 to your computer and use it in GitHub Desktop.
import sys
# Uses httplib2 by default.
# Pass "--requests" command-line arg to use requests.
if "--requests" in sys.argv:
import requests
requests.get("https://auth.hasgeek.com/").content
else:
import httplib2
h = httplib2.Http()
h.request("https://auth.hasgeek.com/", "GET")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment