HTTP - Client


#!/usr/bin/python
import httplib

h = httplib.HTTP('www.little-idiot.de')

h.putrequest('GET', '/index.html')

h.putheader('Accept', 'text/html')

h.putheader('Accept', 'text/plain')

h.endheaders()

errcode, errmsg, headers = h.getreply()

print errcode 

f = h.getfile()

print f.read() 

f.close()