def get(url, params={}):
        """Invoke an HTTP GET request on a url

        Args:
            url (string): URL endpoint to request
            params (dict): Dictionary of url parameters
        Returns:
            dict: JSON response as a dictionary
        """
        request_url = url

        if len(params):
            request_url = "{}?{}".format(url, urlencode(params))

        try:
            req = Request(request_url, headers={'User-Agent': 'Mozilla/5.0'})
            response = json.loads(urlopen(req).read().decode("utf-8"))

            return response
        except HTTPError as err:
            raise MtgException(err.read())
def get ( url , params = { } ) : request_url = url if len ( params ) : request_url = "{}?{}" . format ( url , urlencode ( params ) ) try : req = Request ( request_url , headers = { 'User-Agent' : 'Mozilla/5.0' } ) response = json . loads ( urlopen ( req ) . read ( ) . decode ( "utf-8" ) ) return response except HTTPError as err : raise MtgException ( err . read ( ) )
Invoke an HTTP GET request on a url

        Args:
            url (string): URL endpoint to request
            params (dict): Dictionary of url parameters
        Returns:
            dict: JSON response as a dictionary