do the get request to api
519323
def get_request(url, params = {})
      params = URI.encode_www_form(params.keep_if { |k, v| k && v })
      full_url = params.empty? ? url : [url, params].join('?')
      do_request(full_url, Net::HTTP::Get)
    end
197220
def _get(self, url, query=None, **kwargs):
        

        return self._request('get', url, query, **kwargs)
308041
def get_api_results(url)
      uri = URI.parse(url)
      puts "URL: #{url}" if self.verbose
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true

      request = Net::HTTP::Get.new(uri.request_uri)
      response = http.request(request)

      JSON.parse(response.body)
    end
530625
def api_run_get(run_id):
    """"""
    data = current_app.config["data"]
    run = data.get_run_dao().get(run_id)
    records_total = 1 if run is not None else 0
    if records_total == 0:
        return Response(
            render_template(
                "api/error.js",
                error_code=404,
                error_message="Run %s not found." % run_id),
            status=404,
            mimetype="application/json")
    records_filtered = records_total
    return Response(render_template("api/runs.js", runs=[run], draw=1,
                                    recordsTotal=records_total,
                                    recordsFiltered=records_filtered,
                                    full_object=True),
                    mimetype="application/json")
24780
def get(path, options={}, format=format)
      respond request(:get, path, options, format)
    end
820349
function request(url, payload) {
  return fetch(url, {
    method: 'POST',
    // set to 1000 b/c no response needed
    timeout: 1000,
    body: JSON.stringify(payload),
  })
  .then((response) => {
    if (response.status === 404) {
      return BbPromise.reject('404 api not found');
    }
    return response.json();
  })
  .then((res) => BbPromise.resolve(res))
  .catch((e) => BbPromise.resolve(e));
}
1191047
def do_GET(self):
        
        self.do_initial_operations()
        coap_response = self.client.get(self.coap_uri.path)
        self.client.stop()
        logger.info("Server response: %s", coap_response.pretty_print())
        self.set_http_response(coap_response)
144565
def do_GET(self):
        """"""
        thread_local.clock_start = get_time()
        thread_local.status_code = 200
        thread_local.message = None
        thread_local.headers = []
        thread_local.end_headers = []
        thread_local.size = -1
        thread_local.method = 'GET'
        try:
            self.cross_origin_headers()
            if self.handle_special(True, 'GET'):
                return
            SimpleHTTPRequestHandler.do_GET(self)
        except PreventDefaultResponse as pdr:
            if pdr.code:
                self.send_error(pdr.code, pdr.msg)
        except (KeyboardInterrupt, SystemExit):
            raise
        except Exception:
            self.handle_error()
1246855
def do_get(self, uri):
        
        self.validate_resource_uri(uri)
        return self._connection.get(uri)
959712
async def api_get(self, url, params=None):
        """"""
        request = None
        headers = DEFAULT_HEADERS.copy()
        headers.update({'Session-Token': self._token})

        try:
            with async_timeout.timeout(DEFAULT_TIMEOUT, loop=self._event_loop):
                request = await self._api_session.get(
                    url, headers=headers, params=params)
            # _LOGGER.debug('Get URL: %s', request.url)
            if request.status != 200:
                _LOGGER.error('Error fetching Eight data: %s', request.status)
                return None

            if 'application/json' in request.headers['content-type']:
                request_json = await request.json()
            else:
                _LOGGER.debug('Response was not JSON, returning text.')
                request_json = await request.text()

            return request_json

        except (aiohttp.ClientError, asyncio.TimeoutError,
                ConnectionRefusedError) as err:
            _LOGGER.error('Error fetching Eight data. %s', err)
            return None
990587
def _do_get(self, url, **kwargs):
        
        #TODO:
        # Add error handling. Check for HTTP status here would be much more conveinent than in each calling method
        scaleioapi_post_headers = {'Content-type':'application/json','Version':'1.0'}
        try:
            #response = self._session.get("{}/{}".format(self._api_url, uri)).json()
            response = self._session.get(url)
            if response.status_code == requests.codes.ok:
                self.conn.logger.debug('_do_get() - HTTP response OK, data: %s', response.text)                
                return response
            else:
                self.conn.logger.error('_do_get() - HTTP response error: %s', response.status_code)
                self.conn.logger.error('_do_get() - HTTP response error, data: %s', response.text)                
                raise RuntimeError("_do_get() - HTTP response error" + response.status_code)
        except Exception as e:
            self.conn.logger.error("_do_get() - Unhandled Error Occurred: %s" % str(e)) 
            raise RuntimeError("_do_get() - Communication error with ScaleIO gateway")
        return response
1343723
def api_get(self, action, data, headers=None):
        
        return self._api_request(action, data, 'GET', headers)
51033
function get(options) {
    request({url: options.url, jar : true},
            function (error, response, body) {
        if (!error && response.statusCode == 200) {
            if( options.json ) {
                try {
                    var data = JSON.parse(body);
                    options.callback(null, data);
                } catch(e) {
                    e.response = body;
                    options.callback(e);
                }
            } else {
                options.callback(null, body);
            }
        } else {
            if( !error ) error = {status:response.statusCode};
            options.callback(error);
        }
    }
    );
}
1097872
def _api_get(path, server=None):
    '''
    
    '''
    server = _get_server(server)
    response = requests.get(
            url=_get_url(server['ssl'], server['url'], server['port'], path),
            auth=_get_auth(server['user'], server['password']),
            headers=_get_headers(),
            verify=False
    )
    return _api_response(response)
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
869177
function(options,done) {

    request(options, function (err, response, payload) {
        if (err) {
            console.log('api call error');
            console.log(err);
        }

        done(err, payload, parseRateLimits(response.headers));
    });
}
1179323
def _do_get(self, uri, **kwargs):
        
        #TODO:
        # Add error handling. Check for HTTP status here would be much more conveinent than in each calling method
        scaleioapi_get_headers = {'Content-type':'application/json','Version':'1.0'}
        self.logger.debug("_do_get() " + "{}/{}".format(self._api_url,uri))
        
        if kwargs:
            for key, value in kwargs.iteritems():
                if key == 'headers':
                    scaleio_get_headersvalue = value

        try:
            #response = self._im_session.get("{}/{}".format(self._api_url, uri), headers = scaleioapi_get_headers, payload = scaleio_payload).json()
            response = self._im_session.get("{}/{}".format(self._api_url, uri), **kwargs).json()
            #response = self._session.get(url, headers=scaleioapi_post_headers, **kwargs)
            if response.status_code == requests.codes.ok:
                return response
            else:
                raise RuntimeError("_do_get() - HTTP response error" + response.status_code)
        except:
            raise RuntimeError("_do_get() - Communication error with ScaleIO gateway")
        return response