Make a GET request for url and return the response content as a generic lxml.objectify object
323535
def get(self, url, params=None):
        ''
        url = self.escapeUrl(url)

        content = six.BytesIO(self.raw(url, params=params))
        # We need to make sure that the xml fits in available memory before we parse
        # with lxml.objectify.fromstring(), or else it will bomb out.
        # If it is too big, we need to buffer it to disk before we run it through objectify. see #87
        #
        # get length of buffer
        content.seek(0,2)
        contentlen = content.tell()
        content.seek(0)

        MAX_BUFFER_SIZE=1024*1024*200 # 200MB. TODO: find a way to compute this
        if contentlen > MAX_BUFFER_SIZE:
            # xml is too big to parse with lxml.objectify.fromstring()
            contentfile = tempfile.NamedTemporaryFile()
            contentfile.write(content.read())
            o = lxml.objectify.parse(contentfile)
        else:
            o = lxml.objectify.fromstring(content.getvalue())
        if o.tag == 'error':
            JFSError.raiseError(o, url)
        return o
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
1043028
def get(self, url, params=None, **kwargs):
        """"""
        return requests.get(url, params=params, headers=self.add_headers(**kwargs))
813173
def _get_content(cls, url, headers=HTTP_HEADERS):
        
        session = requests.Session()
        return session.get(url, headers=headers)
70264
def rest_get(url, timeout, show_error=False):
    ''''''
    try:
        response = requests.get(url, timeout=timeout)
        return response
    except Exception as exception:
        if show_error:
            print_error(exception)
        return None
304891
def get(self, params=None):
        
        return self._call('get', url=self.endpoint, params=params)
673708
def _grabContentFromUrl(self, url):
        
        # Defining an empty object for the response
        info = {}
                
        # This part has to be modified...        
        try:            
            # Configuring the socket
            queryURL = "http://" + self.info["host"] + ":" + self.info["port"] + "/" + url
            response = urllib2.urlopen(queryURL)

            # Rebuilding data to be processed
            data = str(response.headers) + "\n"

            data += response.read()

            # Processing data as expected
            info = self._createDataStructure(data)     
            
        # Try to make the errors clear for other users
        except Exception, e:
            errMsg = "ERROR Exception. Something seems to be wrong with the Zeronet Bundler."   
            raise Exception( errMsg + " " + str(e))        
            
        return info
72124
def get(self, *args, **kwargs):
        """"""
        if 'convert' in kwargs:
            conversion = kwargs.pop('convert')
        else:
            conversion = True
        kwargs = self._get_keywords(**kwargs)
        url = self._create_path(*args)
        request = self.session.get(url, params=kwargs)
        content = request.content
        self._request = request
        return self.convert(content, conversion)
423393
def do_get(url, params, to=3):
    
    try:
        rs = requests.get(url, params=params, timeout=to)
        if rs.status_code == 200:
            try:
                return rs.json()
            except Exception as __e:
                # log.error(__e)
                return rs.text
    except Exception as er:
        log.error('get {} ({}) with err: {}'.format(url, params, er))
        time.sleep(0.5)
    return {}
1357606
def get_request(hash=true)
        resp = RestClient.get get_url
        hash ? Hash.from_xml(resp).it_keys_to_sym : resp
      end
659125
def get_req(url):
    """"""
    request = urllib.request.Request(url)
    request.add_header('Authorization', 'token %s' % API_TOKEN)
    try:
        response = urllib.request.urlopen(request).read().decode('utf-8')
        return response
    except urllib.error.HTTPError:
        exception()
        sys.exit(0)
1279513
def _get(url, params=None):
        """"""
        try:
            response = requests.get(url, params=params)
            response.raise_for_status()
            # If JSON fails, return raw data
            # (e.g. when downloading CSV job logs).
            try:
                return response.json()
            except ValueError:
                return response.text
        except NameError:
            url = '{0}?{1}'.format(url, urllib.urlencode(params))
            return json.loads(urllib2.urlopen(url).read().decode(ENCODING))
774406
def get(self, url=None, delimiter="/"):
        
        params = {'Delimiter': delimiter}
        bucket, obj_key = _parse_url(url)

        if bucket:
            params['Bucket'] = bucket
        else:
            return self.call("ListBuckets", response_data_key="Buckets")

        if obj_key:
            params['Prefix'] = obj_key

        objects = self.call("ListObjects", response_data_key="Contents",
                            **params)
        if objects:
            for obj in objects:
                obj['url'] = "s3://{0}/{1}".format(bucket, obj['Key'])

        return objects
826225
def get(self, *args, **kwargs):
        """"""
        location = args[0]
        params = self._get_keywords(location, kwargs)
        url = self._create_path(*args)
        request = requests.get(url, params=params)
        content = request.content
        self._request = request
        return self._output(content)
427699
def get(self, url: str) -> List[dict]:
        
        response = requests.get(
            url,
            headers = {'Content-type': 'application/json'},
            auth = ('scicrunch', 'perl22(query)') # for test2.scicrunch.org
        )
        output = self.process_response(response)
        return output
390108
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())
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)