Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python 2.7
- >>> import httplib
- >>> conn = httplib.HTTPConnection("2ch.so")
- >>> conn.request("GET", "/menu.html")
- >>> r = conn.getresponse()
- >>> r.read().split('\n')
- >>> conn.close()
- Python 3.2
- >>> from http import client
- >>> conn = client.HTTPConnection(r'2ch.so')
- >>> conn.request('GET', '/menu.html')
- >>> r = conn.getresponse()
- >>> r.readlines()
- >>> conn.close()
Advertisement
Add Comment
Please, Sign In to add comment