httplib.HTTPResponse question

Christopher Baus christopher at
Sat Jun 26 04:20:00 CEST 2004

> I'm writing an HTTP client test package in python to test my C++ proxy
> server (  For this reason I want to construct
> the (malformed) HTTP requests myself, but use httplib to parse the
> server's response.  I don't see an easy way to do this.  I suspect I could
> construct the response on the socket and have it read the response, but
> this is undocumented.

To answer my own question.  This isn't documented in the standard python
docs, but it is seems to work:

response = httplib.HTTPResponse(sock)

More information about the Python-list mailing list