(self, host, handler, request_body, verbose)
Make an xmlrpc request.
Make an xmlrpc request.
Make an xmlrpc request .
def request(self, host, handler, request_body, verbose):
        """
        Make an xmlrpc request.
        """
        headers = {'User-Agent': self.user_agent,
                   'Content-Type': 'text/xml',
                   }
        url = self._build_url(host, handler)
        kwargs = {}
        if StrictVersion(requests.__version__) >= StrictVersion('0.8.8'):
            kwargs['verify'] = True
        else:
            if self.use_https:
                warnings.warn(
                    'using https transport but no certificate '
                    'verification. (Hint: upgrade requests package.)')
        try:
            resp = requests.post(url, data=request_body, headers=headers,
                                 **kwargs)
        except ValueError:
            raise
        except Exception:
            raise  # something went wrong
        else:
            try:
                resp.raise_for_status()
            except requests.RequestException as e:
                raise xmlrpc.ProtocolError(
                    url, resp.status_code, str(e), resp.headers)
            else:
                return self.parse_response(resp)
def request ( self , host , handler , request_body , verbose ) : headers = { 'User-Agent' : self . user_agent , 'Content-Type' : 'text/xml' , } url = self . _build_url ( host , handler ) kwargs = { } if StrictVersion ( requests . __version__ ) >= StrictVersion ( '0.8.8' ) : kwargs [ 'verify' ] = True else : if self . use_https : warnings . warn ( 'using https transport but no certificate ' 'verification. (Hint: upgrade requests package.)' ) try : resp = requests . post ( url , data = request_body , headers = headers , * * kwargs ) except ValueError : raise except Exception : raise # something went wrong else : try : resp . raise_for_status ( ) except requests . RequestException as e : raise xmlrpc . ProtocolError ( url , resp . status_code , str ( e ) , resp . headers ) else : return self . parse_response ( resp )