Performs a get request to a given url. Returns an empty str on error.
354081
def get(url, last_modified=None):
    
    try:
        with closing(urllib2.urlopen(url)) as page:
            if last_modified is not None:
                last_mod = dateutil.parser.parse(dict(page.info())['last-modified'])
                if last_mod <= last_modified:
                    return ""
            return page.read()
    except urllib2.URLError:
        return ""
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)
1233899
def rest_get(self, url, params=None, headers=None, auth=None, verify=True, cert=None):
        
        res = requests.get(url, params=params, headers=headers, auth=auth, verify=verify,
                           cert=cert)
        return res.text, res.status_code
231831
def get(self, url):
        
        return requests.get(url, params=self.data, headers=self.config.HEADERS)
548039
def _get_request(self, request_url, request_method, **params):
        
        if request_method == 'GET':
            if params:
                request_url += '&%s' % urlencode(params)
            request = Request(request_url)
        elif request_method == 'POST':
            request = Request(request_url, urlencode(params, doseq=1))
        return request
449034
def geturl_req(url):
    """"""
    request = urllib.request.Request(url)
    request.add_header('Authorization', 'token %s' % API_TOKEN)
    try:
        response_url = urllib.request.urlopen(request).geturl()
        return response_url
    except urllib.error.HTTPError:
        exception()
        sys.exit(0)
1355022
def __request(self, url, params):
        
        log.debug('request: %s %s' %(url, str(params)))
        try:
            response = urlopen(url, urlencode(params)).read()
            if params.get('action') != 'data':
                log.debug('response: %s' % response)
            if params.get('action', None) == 'data':
                return response
            else:
                return json.loads(response)
        except TypeError, e:
            log.exception('request error')
            raise ServerError(e)
        except IOError, e:
            log.error('request error: %s' % str(e))
            raise ServerError(e)
947787
def get(self, url, params=None, headers=None, content=None, form_content=None):
        # type: (str, Optional[Dict[str, str]], Optional[Dict[str, str]], Any, Optional[Dict[str, Any]]) -> ClientRequest
        
        request = self._request('GET', url, params, headers, content, form_content)
        request.method = 'GET'
        return request
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"
150952
def fetch(self, url):
        
        try:
            r = requests.get(url, timeout=self.timeout)
        except requests.exceptions.Timeout:
            if not self.safe:
                raise
            else:
                return None
        
        # Raise 404/500 error if any
        if r and not self.safe:
            r.raise_for_status()
        
        return r.text
1175926
def _get(url:str, headers:dict) -> dict:
    
    response = requests.get(url, headers=headers)

    data = response.json()
    if response.status_code != 200:
        raise GoogleApiError({"status_code": response.status_code,
                                  "error": data.get("error", "")})
    return data
229417
def get(self, url):
        '''  '''
        req = r.get(url,
                    headers = self.headers,
                    auth    = self.auth)
        return self.process_request(req)
1319846
def _get_request(self, url, headers, params=None):
        
        return self._session.get(url, headers=headers, params=params)
825195
def _get(self, url, params=None):
        
        self._call(self.GET, url, params, None)
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()
314710
def get_url(url, catch_exception=False):
    
    return _get_url(url, catch_exception, urlopen=urllib2.urlopen)