b.t.h._.AbstractHTTPHandler(urllib2.AbstractHTTPHandler) : class documentation

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

Known subclasses: bzrlib.transport.http._urllib2_wrappers.HTTPHandler, bzrlib.transport.http._urllib2_wrappers.HTTPSHandler

A custom handler for HTTP(S) requests.

We overrive urllib2.AbstractHTTPHandler to get a better control of the connection, the ability to implement new request types and return a response able to cope with persistent connections.

Method __init__ Undocumented
Method http_request Common headers setting
Method retry_or_raise Retry the request (once) or raise the exception.
Method do_open See urllib2.AbstractHTTPHandler.do_open for the general idea.
def __init__(self):
Undocumented
def http_request(self, request):
Common headers setting
def retry_or_raise(self, http_class, request, first_try):
Retry the request (once) or raise the exception.

urllib2 raises exception of application level kind, we just have to translate them.

httplib can raise exceptions of transport level (badly formatted dialog, loss of connexion or socket level problems). In that case we should issue the request again (httplib will close and reopen a new connection if needed).

def do_open(self, http_class, request, first_try=True):
See urllib2.AbstractHTTPHandler.do_open for the general idea.

The request will be retried once if it fails.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.