Send GET request.
358790
def _send_request(self, request, **kwargs):
        """"""
        log.debug(LOG_CHECK, "Send request %s with %s", request, kwargs)
        log.debug(LOG_CHECK, "Request headers %s", request.headers)
        self.url_connection = self.session.send(request, **kwargs)
        self.headers = self.url_connection.headers
        self._add_ssl_info()
925683
def post(self, url, data=None, **kwargs):
        """"""
        return requests.post(url, data=data, headers=self.add_headers(**kwargs))
315665
def _call(self, method, url, params):
        """"""
        request_params = {}
        if method == 'GET':
            request_params['params'] = params
        elif method == 'POST':
            request_params['data'] = params
        response = requests.request(method, url, **request_params)
        return response
781189
def request(url, message):
    """"""
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    host, port = url.split(':')
    port = int(port)
    s.connect((host, port))
    s.send(pack(message))
    data = s.makefile().read()
    s.close()
    return data
827982
def get(self, url, headers=None, kwargs=None):
        
        return self._request(
            method='get',
            url=url,
            headers=headers,
            kwargs=kwargs
        )
1164585
async def request(self, method, path, json=None, auth=True):
        """"""
        url = 'http://{}/api/'.format(self.host)
        if auth:
            url += '{}/'.format(self.username)
        url += path

        try:
            async with self.websession.request(method, url, json=json) as res:
                if res.content_type != 'application/json':
                    raise ResponseError(
                        'Invalid content type: {}'.format(res.content_type))
                data = await res.json()
                _raise_on_error(data)
                return data
        except client_exceptions.ClientError as err:
            raise RequestError(
                'Error requesting data from {}: {}'.format(self.host, err)
            ) from None
141698
def _get(self, url, params={}):
        """"""
        r = requests.get(self._api_prefix + url,
            params=params,
            headers=self.headers,
            auth=self.auth,
        )
        return self._action(r)
480381
def _send(self, method, route, data, params, **kwargs):
        """"""
        route = self._fmt_route(route, params)
        log(_("sending {} request to {}").format(method.upper(), route))
        try:
            self.response = getattr(self._client, method.lower())(route, data=data, **kwargs)
        except BaseException as e:  # Catch all exceptions thrown by app
            log(_("exception raised in application: {}: {}").format(type(e).__name__, e))
            raise Failure(_("application raised an exception (rerun with --log for more details)"))
        return self
423715
def on_get(self, req, resp, **kwargs):
        """"""
        return super().on_get(
            req, resp, handler=self._retrieve, **kwargs
        )
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')
843234
def _get(operation: Operation, url=URL, **params):
    """"""
    prepped_request = _prep_get(operation, url=url, **params)
    return cgi.send(prepped_request)
229417
def get(self, url):
        '''  '''
        req = r.get(url,
                    headers = self.headers,
                    auth    = self.auth)
        return self.process_request(req)
323199
def _make_request(self, path, method='GET', params_=None):
        """"""
        uri = self.api_root + path
        if params_:
            params_['text_format'] = self.response_format
        else:
            params_ = {'text_format': self.response_format}

        # Make the request
        response = None
        try:
            response = self._session.request(method, uri,
                                            timeout=self.timeout,
                                            params=params_)
        except Timeout as e:
            print("Timeout raised and caught:\n{e}".format(e=e))

        # Enforce rate limiting
        time.sleep(max(self._SLEEP_MIN, self.sleep_time))
        return response.json()['response'] if response else None
605133
def get(self, url, params=None, callback=None, retry=0, **kwargs):
        """"""
        kwargs.setdefault("allow_redirects", True)
        return self.request(
            "get", url=url, params=params, callback=callback, retry=retry, **kwargs
        )
650185
def _request(self, url, params=None, timeout=10):
        """"""
        rsp = self._session.get(url, params=params, timeout=timeout)
        rsp.raise_for_status()
        return rsp.text.strip()
1261663
def get_request(self, request):
        """"""
        request.transport_user = self.username
        request.transport_password = self.api_key
        return request
1192449
def send_get_request(connection, url, options, custom_params = nil)
      rest_options = parse_options(options)
      url += rest_options[:query_params]
      url += custom_params unless custom_params.nil?
      begin
        connection.get do |req|
          req.options[:params_encoder] = options[:params_encoder] if options[:params_encoder]
          req.url rest_options[:url_prefix] ? rest_options[:url_prefix] + concat_url(url) : concat_url(url)
          rest_options[:headers].map { |k, v| req.headers[k.to_sym] = v } unless rest_options[:headers].nil?
          req.options.timeout = options[:timeout] if options[:timeout]
        end
      rescue Faraday::ClientError => e
        raise Diplomat::PathNotFound, e
      end
    end