def _request(self, host, handler, request_body, verbose=0): # issue XML-RPC request h = self.cache.get_connection() try: self.set_connection_params(h) h.add_data(request_body) response = pycurllib.urlopen(h, close=False) #errcode, errmsg, headers = h.getreply() errcode = response.code errmsg = response.msg headers = "N/A" if errcode != 200: raise xmlrpclib.ProtocolError( host + handler, errcode, errmsg, headers ) self.verbose = verbose r = self._parse_response(response) finally: self.cache.put_connection(h) return r
def _request(self, host, handler, request_body, verbose=0): # issue XML-RPC request h = self.cache.get_connection() try: self.set_connection_params(h) h.add_data(request_body) response = pycurllib.urlopen(h, close=False) #errcode, errmsg, headers = h.getreply() errcode = response.code errmsg = response.msg headers = "N/A" if errcode != 200: raise xmlrpclib.ProtocolError(host + handler, errcode, errmsg, headers) self.verbose = verbose r = self._parse_response(response) finally: self.cache.put_connection(h) return r
def _request(self, host, handler, request_body, verbose=0): # issue XML-RPC request h = self.cache.get_connection() try: self._set_connection_params(h) h.add_data(request_body) response = pycurllib.urlopen(h, close=False) except: # connection may no longer be valid self.cache.destroy_connection(h) raise self.cache.put_connection(h) if response.code != 200: raise xmlrpclib.ProtocolError( host + handler, response.code, response.msg, 'N/A', ) self.verbose = verbose return self._parse_response(response)