(self, query)
return r
Request an url
Request an url
Request an url
def _request(self, query):
        """
        Request an url
        """
        r = requests.get('https://haveibeenpwned.com' + query, headers= {'User-Agent': self.ua, 'hibp-api-key': self.key})
        if r.status_code != 200:
            if r.status_code == 404:
                raise HibpNotFound()
            else:
                raise HibpError('Invalid HTTP status code %i' % r.status_code)
        return r
def _request ( self , query ) : r = requests . get ( 'https://haveibeenpwned.com' + query , headers = { 'User-Agent' : self . ua , 'hibp-api-key' : self . key } ) if r . status_code != 200 : if r . status_code == 404 : raise HibpNotFound ( ) else : raise HibpError ( 'Invalid HTTP status code %i' % r . status_code ) return r