Created
December 16, 2013 05:16
-
-
Save studiawan/7982641 to your computer and use it in GitHub Desktop.
HTTP client using primitive httplib
This file contains hidden or 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
#!/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