(self, path, data={})
Query the API with the given path
Query the API with the given path
Query the API with the given path
def _request(self, path, data={}):
        """
        Query the API with the given path
        """
        headers = { 'User-Agent': self.ua }
        r = requests.get(self.base_url + path, auth=HTTPBasicAuth(self.key, self.secret), headers=headers, params=data)
        if r.status_code != 200:
            raise HybridAnalysisFailed()
        else:
            res = r.json()
            if 'response_code' in res:
                if res['response_code'] == 0:
                    return res['response']
            raise HybridAnalysisFailed()
def _request ( self , path , data = { } ) : headers = { 'User-Agent' : self . ua } r = requests . get ( self . base_url + path , auth = HTTPBasicAuth ( self . key , self . secret ) , headers = headers , params = data ) if r . status_code != 200 : raise HybridAnalysisFailed ( ) else : res = r . json ( ) if 'response_code' in res : if res [ 'response_code' ] == 0 : return res [ 'response' ] raise HybridAnalysisFailed ( )