Perform a GET request for the url and return a dictionary parsed from
        the JSON response.
347943
def get_url(url: str) -> Union[dict, int, float, str]:
        ''''''

        request = Request(url, headers={"User-Agent": "pypeerassets"})
        response = cast(HTTPResponse, urlopen(request))
        if response.status != 200:
            raise Exception(response.reason)
        return json.loads(response.read().decode())
871330
def _get(self, url):
        """"""
        self.logger.info(f'Sending request: {RequestHandler.BASE_URL+url}')
        req = requests.get(RequestHandler.BASE_URL+url, headers=self.headers)
        self.logger.info(f'Request returned with status code {req.status_code}')

        if req.status_code == requests.codes.ok:
            return req

        if req.status_code == requests.codes.bad:
            raise APIErrorException('Invalid request. Check parameters.', req.status_code)

        if req.status_code == requests.codes.forbidden:
            raise APIErrorException('This resource is restricted', req.status_code)

        if req.status_code == requests.codes.not_found:
            raise APIErrorException('This resource does not exist. Check parameters', req.status_code)

        if req.status_code == requests.codes.too_many_requests:
            raise APIErrorException('You have exceeded your allowed requests per minute/day', req.status_code)
149226
def get(self, url, data=None, params=None):
        
        return self.request("get", url, data, params)
1160298
def get_jsonparsed_data(url):
    
    response = urlopen(url)
    data = response.read().decode('utf-8')
    return json.loads(data)
1176090
def response(self, url):
        """"""
        
        resp = requests.get(url).content
        return self.parseresponse(resp)
237965
def get_json_online(self, url):
        
        if not requests:
            return False
        try:
            req = requests.get(url, timeout=.2)
            if not req.ok:
                return []
            return req
        except (requests.exceptions.ConnectTimeout, requests.exceptions.ConnectionError,
                requests.exceptions.ReadTimeout):
            return []
998507
def getResponse(self, url):
             
        # Defining an empty object for the response
        response = {}
        try:
            # This receives only the parameters needed by this Tor Wrapper:
            # {
            #    "host" : "127.0.0.1"
            #    "port" : "9150"
            # }  
            self.info = self._getConfiguration()
        
            response = self._grabContentFromUrl(url)
        except Exception, e:
            response["status"] = { "code" : 400, "desc" : str(e) }            
            
        # Adding other known data            
        response["time_processed"] = str(dt.datetime.now())
        
        response["domain"] = self.getDomainFromUrl(url)
        response["url"] = url          

        try:
            # We'll check if something happened...    
            response["status"]
        except Exception, e:
            # If nothing happened till now, we'll set the code as 200             
            response["status"] = { "code" : 200, "desc" : "OK." }
                    
        return response
245081
def requests_get(url):
    

    LOGGER.info(u'Fetching %s…', url)
    return requests.get(url)
1083185
def get_json(session, url, params: dict = None):
    
    res = session.get(url, params=params)
    if res.status_code >= 400:
        raise parse_error(res)
    return res.json()
22088
def _get(self, url, params={}):
        """"""
        req = self._session.get(self._api_prefix + url, params=params)
        return self._action(req)
48312
def _get(self, url, **kw):
        '''
        
        '''
        headers = kw.pop('headers', {})
        headers.setdefault('Content-Type', 'application/json')
        headers.setdefault('Accept', 'application/json')
        headers.setdefault('Authorization', self.AUTHORIZATION_HEADER)
        kw['headers'] = headers
        resp = self.session.get(url, **kw)
        self._raise_for_status(resp)
        return resp
340715
def get(self, url):
        
        r = requests.get(self._format_url(url), headers=self.headers, timeout=TIMEOUT)
        self._check_response(r, 200)

        return r.json()
1125870
def _get(self, uri, params=None, headers=None):
        
        if not headers:
            headers = self._get_headers()

        logging.debug("URI=" + str(uri))
        logging.debug("HEADERS=" + str(headers))

        response = self.session.get(uri, headers=headers, params=params)
        logging.debug("STATUS=" + str(response.status_code))
        if response.status_code == 200:
            return response.json()
        else:
            logging.error(b"ERROR=" + response.content)
            response.raise_for_status()
139838
def parseUrl(url):
    
    scheme, netloc, url, params, query, fragment = urllib.parse.urlparse(url)
    query_dict = {
        k: sorted(v) if len(v) > 1 else v[0]
        for k, v in list(urllib.parse.parse_qs(query).items())
    }
    return {
        'scheme': scheme,
        'netloc': netloc,
        'url': url,
        'params': params,
        'query': query_dict,
        'fragment': fragment,
    }
1022591
def _make_request(self, url, **kwargs):
        
        response = requests.post(url, **kwargs)
        try:
            return response.json()
        except ValueError:
            pass
        return parse_qs(response.content)
94880
def _get(self, url):
        """"""
        req = requests.get(RequestHandler.BASE_URL + url, headers=self.headers)
        status_code = req.status_code
        if status_code == requests.codes.ok:
            return req
        elif status_code == requests.codes.bad:
            raise APIErrorException('Invalid request. Check parameters.')
        elif status_code == requests.codes.forbidden:
            raise APIErrorException('This resource is restricted')
        elif status_code == requests.codes.not_found:
            raise APIErrorException('This resource does not exist. Check parameters')
        elif status_code == requests.codes.too_many_requests:
            raise APIErrorException('You have exceeded your allowed requests per minute/day')
229417
def get(self, url):
        '''  '''
        req = r.get(url,
                    headers = self.headers,
                    auth    = self.auth)
        return self.process_request(req)