luminoso_api/v4_client.py
def _json_request(self, req_type, url, **kwargs):
        """
        Make a request of the specified type and expect a JSON object in
        response.

        If the result has an 'error' value, raise a LuminosoAPIError with
        its contents. Otherwise, return the contents of the 'result' value.
        """
        response = self._request(req_type, url, **kwargs)
        try:
            json_response = response.json()
        except ValueError:
            logger.error("Received response with no JSON: %s %s" %
                         (response, response.content))
            raise LuminosoError('Response body contained no JSON. '
                                'Perhaps you meant to use get_raw?')
        if json_response.get('error'):
            raise LuminosoAPIError(json_response.get('error'))
        return json_response['result']
def _json_request(self, req_type, url, **kwargs):
        response = self._request(req_type, url, **kwargs)
        try:
            json_response = response.json()
        except ValueError:
            logger.error("Received response with no JSON: %s %s" %
                         (response, response.content))
            raise LuminosoError('Response body contained no JSON. '
                                'Perhaps you meant to use get_raw?')
        if json_response.get('error'):
            raise LuminosoAPIError(json_response.get('error'))
        return json_response['result']
def _json_request ( self , req_type , url , * * kwargs ) : response = self . _request ( req_type , url , * * kwargs ) try : json_response = response . json ( ) except ValueError : logger . error ( "Received response with no JSON: %s %s" % ( response , response . content ) ) raise LuminosoError ( 'Response body contained no JSON. ' 'Perhaps you meant to use get_raw?' ) if json_response . get ( 'error' ) : raise LuminosoAPIError ( json_response . get ( 'error' ) ) return json_response [ 'result' ]
Make a request of the specified type and expect a JSON object in
        response.

        If the result has an 'error' value, raise a LuminosoAPIError with
        its contents. Otherwise, return the contents of the 'result' value.
Make a request of the specified type and expect a JSON object in response .