def putURL(self, url, data=None, **kwargs): # httplib isn't sending a Content-Length: 0 header for empty bodies # even though the latest HTTP revision says this is legal, cherrypy and # some other servers don't like it # this may be fixed in python 2.7.4 if not data: kwargs.setdefault('headers', {})['Content-Length'] = '0' return SAMWebHTTPClient.putURL(self, url, data, **kwargs)
def putURL(self, url, data=None, **kwargs): # httplib isn't sending a Content-Length: 0 header for empty bodies # even though the latest HTTP revision says this is legal, cherrypy and # some other servers don't like it # this may be fixed in python 2.7.4 if not data: kwargs.setdefault('headers',{})['Content-Length'] = '0' return SAMWebHTTPClient.putURL(self, url, data, **kwargs)
def use_client_certificate(self, cert=None, key=None): SAMWebHTTPClient.use_client_certificate(self, cert, key) self._session = None # This will clear any existing session with a different cert
def __init__(self, verbose=False, *args, **kwargs): SAMWebHTTPClient.__init__(self, *args, **kwargs) self._session = None self.verbose = verbose
def _get_user_agent(self): ua = SAMWebHTTPClient._get_user_agent(self) ua += " requests/%s" % requests.__version__ return ua
def use_client_certificate(self, cert=None, key=None): """ Use the given certificate and key for client ssl authentication """ SAMWebHTTPClient.use_client_certificate(self, cert, key) self._opener = urllib2.build_opener(HTTPSClientAuthHandler(self._cert), HTTP307RedirectHandler)
def __init__(self, *args, **kwargs): SAMWebHTTPClient.__init__(self, *args, **kwargs) self._opener = urllib2.build_opener(HTTP307RedirectHandler())
def use_client_certificate(self, cert=None, key=None): """ Use the given certificate and key for client ssl authentication """ SAMWebHTTPClient.use_client_certificate(self, cert, key) self._opener = urllib2.build_opener(HTTPSClientAuthHandler(self._cert), HTTP307RedirectHandler )