run a get request against an url. Returns the response which can optionally be streamed
18528
def _get(self, route, stream=False):
        
        log.debug("Running GET request against %s" % route)
        return r.get(self._url(route), auth=c.auth, stream=stream)
717281
async def fastStreamedQuery(self, url, *, headers=None, verify=True):
    
    response = await self.session.get(url,
                                      headers=self._buildHeaders(headers),
                                      timeout=HTTP_SHORT_TIMEOUT,
                                      ssl=verify)

    response.raise_for_status()

    return response
230540
def get(self, url, **kwargs):
        
        """

        kwargs.setdefault('allow_redirects', True)
        return self.request('GET', url, **kwargs)
1269243
def get(self, request, *args, **kwargs):
        
        response = super().get(request, args, kwargs)
        try:
            response.render()
        except Http404:
            request.GET = request.GET.copy()
            request.GET['page'] = '1'
            response = super().get(request, args, kwargs)
            response.status_code = 404

        return response
56487
def get(self, request, *args, **kwargs):
        
        entry = self.get_object()
        return HttpResponsePermanentRedirect(entry.get_absolute_url())
389174
def _request(self, uri, params=None, postParams=None, verb='GET'):
        """"""
        return getattr(requests, verb.lower())(self.url + uri, params=params, data=postParams, stream=True)
274641
def _make_request(self, suburl):
        
        url = "{}/{}".format(self.API_BASE_URL, suburl)
        response = self.session.get(url)
        response.raise_for_status()
        return response.json()
771181
def execute_from_url(self, url, input_url):
        '''
        

        '''
        inputs = self._request(input_url)
        resp = self.execute(url, inputs)
        return resp
22088
def _get(self, url, params={}):
        """"""
        req = self._session.get(self._api_prefix + url, params=params)
        return self._action(req)
1103529
def __stream_request(self, method, url, request_args, headers=None):
        
        headers = headers if headers else {}
        response = self.__request(method, url, request_args,
                                  headers=headers, stream=True)
        lines = response.iter_lines(ITER_LINES_CHUNKSIZE)
        for line in lines:
            if line:
                data = json.loads(line.decode("utf-8"))
                yield data
443893
def get(url, **kwargs):
    
    headers = kwargs.get('headers', {})
    headers['User-Agent'] = config.USER_AGENT # overwrite
    kwargs['headers'] = headers

    timeout = kwargs.get('timeout', config.TIMEOUT)
    kwargs['timeout'] = timeout

    kwargs['verify'] = False # no SSLError

    logger.debug("Getting: %s", url)
    return requests.get(url, **kwargs)
267755
def http_stream(url, chunk=4096):
    
    ret = requests.get(url, stream=True)
    ret.raise_for_status()
    for data in ret.iter_content(chunk):
        yield data
249674
def get(self, url, params=None, raw=False, stream=False, **request_kwargs):
        

        full_url = self.build_url(url)
        params = params or {}

        # Add token (if it's not already there)
        if self._token:
            params.setdefault('token', self._token)

        response = requests.get(full_url, params=params, stream=stream,
                                **request_kwargs)
        self.check_for_errors(response)  # Raise exception if something failed

        if stream:
            return response
        if raw or not response.content:
            return response.content
        return json.loads(response.text)
990315
def rest_get(url, timeout):
    ''''''
    try:
        response = requests.get(url, timeout=timeout)
        return response
    except Exception as e:
        print('Get exception {0} when sending http get to url {1}'.format(str(e), url))
        return None
725753
def _request(self, url, method="GET", params=None, api_call=None):
        """"""
        method = method.lower()
        params = params or {}
        func = getattr(requests, method)
        requests_args = {}
        if method == "get" or method == "delete":
            requests_args["params"] = params
        else:
            if params.get("json"):
                requests_args["json"] = params.get("json")
            if params.get("files"):
                requests_args["files"] = params.get("files")
            if params.get("data"):
                requests_args["data"] = params.get("data")
        try:
            response = func(url, **requests_args)
        except requests.RequestException as e:
            raise SafecastPyError(str(e))
        # greater than 304 (not modified) is an error
        if response.status_code > 304:
            if response.status_code == 401:
                raise SafecastPyAuthError(response.json().get("error"))
            if response.status_code in [422]:
                raise SafecastPyError(response.json().get("errors"))
            raise SafecastPyError(response.content, error_code=response.status_code)
        try:
            if response.status_code == 204:
                content = response.content
            else:
                content = response.json()
        except ValueError:
            raise SafecastPyError(
                "Response was not valid JSON. \
                               Unable to decode."
            )
        return content
1244103
def get(self, url, params=dict()):
        
        try:
            res = requests.get(url, headers=self.headers, params=params)
            return json.loads(res.text)
        except Exception as e:
            print(e)
            return "error"
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)