Esempio n. 1
0
 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
Esempio n. 6
0
 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)
Esempio n. 7
0
 def __init__(self, *args, **kwargs):
     SAMWebHTTPClient.__init__(self, *args, **kwargs)
     self._opener = urllib2.build_opener(HTTP307RedirectHandler())
Esempio n. 8
0
 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
Esempio n. 9
0
 def __init__(self, verbose=False, *args, **kwargs):
     SAMWebHTTPClient.__init__(self, *args, **kwargs)
     self._session = None
     self.verbose = verbose
Esempio n. 10
0
 def _get_user_agent(self):
     ua = SAMWebHTTPClient._get_user_agent(self)
     ua += " requests/%s" % requests.__version__
     return ua
Esempio n. 11
0
 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 )
Esempio n. 12
0
 def __init__(self, *args, **kwargs):
     SAMWebHTTPClient.__init__(self, *args, **kwargs)
     self._opener = urllib2.build_opener(HTTP307RedirectHandler())