Skip to content

Instantly share code, notes, and snippets.

@studiawan
Created December 16, 2013 05:16
Show Gist options
  • Save studiawan/7982641 to your computer and use it in GitHub Desktop.
Save studiawan/7982641 to your computer and use it in GitHub Desktop.
HTTP client using primitive httplib
#!/usr/bin/env python
import httplib
connection = httplib.HTTPConnection("its.ac.id")
connection.request("GET", "/index.php")
response = connection.getresponse()
header = response.getheaders()
print "Status:", response.status, response.reason
print "Response header:"
for item in header:
print item
print "Content:", response.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment