b.t.h._.Response(httplib.HTTPResponse) : class documentation

Part of bzrlib.transport.http._urllib2_wrappers View In Hierarchy

Custom HTTPResponse, to avoid the need to decorate.

httplib prefers to decorate the returned objects, rather than using a custom object.

Method begin Begin to read the response from the server.
Method finish Finish reading the body.
def begin(self):
Begin to read the response from the server.

httplib assumes that some responses get no content and do not even attempt to read the body in that case, leaving the body in the socket, blocking the next request. Let's try to workaround that.

def finish(self):
Finish reading the body.

In some cases, the client may have left some bytes to read in the body. That will block the next request to succeed if we use a persistent connection. If we don't use a persistent connection, well, nothing will block the next request since a new connection will be issued anyway.

Returnsthe number of bytes left on the socket (may be None)
API Documentation for Bazaar, generated by pydoctor at 2020-08-10 00:50:25.