HTTPConncetion - HEAD request

gervaz gervaz at gmail.com
Thu Jun 16 18:43:42 EDT 2011


Hi all, can someone tell me why the read() function in the following
py3 code returns b''?

>>> h = http.client.HTTPConnection("www.twitter.com")
>>> h.connect()
>>> h.request("HEAD", "/", "HTTP 1.0")
>>> r = h.getresponse()
>>> r.read()
b''

Thanks,

Mattia



More information about the Python-list mailing list