def u2handlers(self): # try to import ntlm support try: from ntlm import HTTPNtlmAuthHandler except ImportError: raise Exception("Cannot import python-ntlm module") handlers = HttpTransport.u2handlers(self) handlers.append(HTTPNtlmAuthHandler.HTTPNtlmAuthHandler(self.pm)) return handlers
def __init__(self, **kwargs): """ @param kwargs: Keyword arguments. - B{proxy} - An http proxy to be specified on requests. The proxy is defined as {protocol:proxy,} - type: I{dict} - default: {} - B{timeout} - Set the url open timeout (seconds). - type: I{float} - default: 90 - B{username} - The username used for http authentication. - type: I{str} - default: None - B{password} - The password used for http authentication. - type: I{str} - default: None """ HttpTransport.__init__(self, **kwargs) self.pm = u2.HTTPPasswordMgrWithDefaultRealm()
def u2handlers(self): handlers = HttpTransport.u2handlers(self) handlers.append(u2.HTTPBasicAuthHandler(self.pm)) return handlers
def send(self, request): self.addcredentials(request) return HttpTransport.send(self, request)
def open(self, request): self.addcredentials(request) return HttpTransport.open(self, request)