perceval/backends/core/phabricator.py
def _call(self, method, params):
        """Call a method.

        :param method: method to call
        :param params: dict with the HTTP parameters needed to call
            the given method

        :raises ConduitError: when an error is returned by the server
        """
        url = self.URL % {'base': self.base_url, 'method': method}

        # Conduit and POST parameters
        params['__conduit__'] = {'token': self.api_token}

        data = {
            'params': json.dumps(params, sort_keys=True),
            'output': 'json',
            '__conduit__': True
        }

        logger.debug("Phabricator Conduit client requests: %s params: %s",
                     method, str(data))

        r = self.fetch(url, payload=data, method=HttpClient.POST, verify=False)

        # Check for possible Conduit API errors
        result = r.json()

        if result['error_code']:
            raise ConduitError(error=result['error_info'],
                               code=result['error_code'])

        return r.text
def _call(self, method, params):
        url = self.URL % {'base': self.base_url, 'method': method}

        # Conduit and POST parameters
        params['__conduit__'] = {'token': self.api_token}

        data = {
            'params': json.dumps(params, sort_keys=True),
            'output': 'json',
            '__conduit__': True
        }

        logger.debug("Phabricator Conduit client requests: %s params: %s",
                     method, str(data))

        r = self.fetch(url, payload=data, method=HttpClient.POST, verify=False)

        # Check for possible Conduit API errors
        result = r.json()

        if result['error_code']:
            raise ConduitError(error=result['error_info'],
                               code=result['error_code'])

        return r.text
def _call ( self , method , params ) : url = self . URL % { 'base' : self . base_url , 'method' : method } # Conduit and POST parameters params [ '__conduit__' ] = { 'token' : self . api_token } data = { 'params' : json . dumps ( params , sort_keys = True ) , 'output' : 'json' , '__conduit__' : True } logger . debug ( "Phabricator Conduit client requests: %s params: %s" , method , str ( data ) ) r = self . fetch ( url , payload = data , method = HttpClient . POST , verify = False ) # Check for possible Conduit API errors result = r . json ( ) if result [ 'error_code' ] : raise ConduitError ( error = result [ 'error_info' ] , code = result [ 'error_code' ] ) return r . text
Call a method.

        :param method: method to call
        :param params: dict with the HTTP parameters needed to call
            the given method

        :raises ConduitError: when an error is returned by the server
Call a method .