Sends the http request implied by the self.query
        In addition, set up the request such that we can call next()
        to provide the next page of results
339587
def execute(self):
        
        self.response = SolrResponse.load_http_response(
            self.session.get(self.HTTP_ENDPOINT, params=self.query)
        )

        # ADS will apply a ceiling to 'rows' and re-write the query
        # This code checks if that happened by comparing the reponse
        # "rows" with what we sent in our query
        # references https://github.com/andycasey/ads/issues/45
        recv_rows = int(self.response.responseHeader.get("params", {}).get("rows"))
        if recv_rows != self.query.get("rows"):
            self._query['rows'] = recv_rows
            warnings.warn("Response rows did not match input rows. "
                          "Setting this query's rows to {}".format(self.query['rows']))

        self._articles.extend(self.response.articles)
        if self._query.get('start') is not None:
            self._query['start'] += self._query['rows']
        elif self._query.get('cursorMark') is not None:
            self._query['cursorMark'] = self.response.json.get("nextCursorMark")

        self._highlights.update(self.response.json.get("highlighting", {}))
513311
def _put_request(self, url, headers, data=None):
        
        return self._session.put(url, headers=headers, data=data)
780462
def request_get_next(request, default_next):
    
    next_url = request.POST.get('next')\
        or request.GET.get('next')\
        or request.META.get('HTTP_REFERER')\
        or default_next
    return next_url
641356
def more
      if more?
        url = Addressable::URI.parse(http_response.links[:next])
        self.class.new(
          @connection,
          url.path,
          @klass,
          @parent
        ).tap do |collection|
          collection.parameters = url.query_values
        end
      else
        raise PaginationError, %{Collection has no 'Link: <url>; rel="next"' header}
      end
    end
1094307
def request(self, method, url, params=None, data=None, headers=None, auth=None,
                timeout=None, allow_redirects=False):
        
        raise TwilioException('HttpClient is an abstract class')
891841
def prepare_request(self, *args, **kw):
        
        self.http_request = self.request_class(self.path, *args, **kw)
197220
def _get(self, url, query=None, **kwargs):
        

        return self._request('get', url, query, **kwargs)
817746
function (request, response, next) {
                if (!next) {
                    next = makeDefaultNext(request, response);
                }
                try {
                    var url = request.url;
                    var questionIndex = url.indexOf("?");
                    var querystring = "";
                    if (questionIndex !== -1) {
                        // if there is a querystring, we'll just chop that part off
                        // it's still preserved in request.url, and should be handled
                        // by other middleware.
                        querystring = url.substring(questionIndex);
                        url = url.substring(0, questionIndex);
                    }
                    
                    var now = +new Date();
                    if (cacheExpirationTime < now) {
                        // time to reset the dynamic cache cache
                        
                        // Object.create(null) is used instead of {} so it doesn't have a prototype of Object.prototype
                        dynamicRouteCache = Object.create(null);
                        redirectCache = Object.create(null);
                        cacheExpirationTime = now + CACHE_CLEAR_TIME;
                    }
                    
                    var actualUrl = url;
                    var cachedResult = redirectCache[actualUrl];
                    if (cachedResult) {
                        movedPermanently(response, cachedResult + querystring);
                        return;
                    }
                    
                    var lowerMethod = request.method.toLowerCase();
                    if (url.length > 1 && url[url.length - 1] === "/") {
                        url = trimEndingSlashes(url);
                    }
                    var lowerUrl = url.toLowerCase();
                    var staticRoute = staticRoutes[lowerUrl];
                    var params;
                    var callback;
                    var descriptor;
                    var properUrl;
                    
                    if (staticRoute) {
                        properUrl = staticRoute.route;
                        if (properUrl !== actualUrl) {
                            redirectCache[actualUrl] = properUrl;
                            movedPermanently(response, properUrl + querystring);
                            return;
                        }
                        
                        descriptor = staticRoute.descriptor;
                        
                        // we found a static route
                        callback = descriptor[lowerMethod];
                        
                        if (!callback) {
                            // the URL exists, but does not have the provided method defined for it
                            methodNotAllowedHandler(request, response, next);
                            return;
                        }

                        params = emptyParams;
                    } else {
                        cachedResult = dynamicRouteCache[actualUrl];
                        if (cachedResult) {
                            descriptor = cachedResult.descriptor;
                            callback = descriptor[lowerMethod];
                            if (!callback) {
                                // the URL exists, but does not have the provided method defined for it
                                methodNotAllowedHandler(request, response, next);
                                return;
                            }
                            params = cachedResult.params;
                        } else {
                            searchDynamicRoutes:
                            for (var i = 0, len = dynamicRoutes.length; i < len; i += 1) {
                                var dynamicRoute = dynamicRoutes[i];
                                var prefix = dynamicRoute.prefix;
                            
                                if (prefix !== "/" && !startsWith(lowerUrl, prefix)) {
                                    continue;
                                }
                            
                                var routes = dynamicRoute.routes;
                                searchWithinPrefix:
                                for (var j = 0, lenJ = routes.length; j < lenJ; j += 1) {
                                    var route = routes[j];
                                    var match = route.regex.exec(url);
                                    if (!match) {
                                        continue;
                                    }
                                
                                    descriptor = route.descriptor;
                                    callback = descriptor[lowerMethod];
                                    if (!callback) {
                                        // the URL exists, but does not have the provided method defined for it
                                        methodNotAllowedHandler(request, response, next);
                                        return;
                                    }
                                
                                    var literals = route.literals;
                                    properUrl = literals[0];
                                    var argumentNames = route.argumentNames;
                                    var converters = route.converters;
                                    params = {};
                                    for (var k = 0, lenK = argumentNames.length; k < lenK; k += 1) {
                                        var unconvertedValue = match[k * 2 + 2];
                                        var convertedValue;
                                        try {
                                            convertedValue = converters[k](unconvertedValue);
                                        } catch (ex) {
                                            if (ex instanceof escort.ValidationError) {
                                                // if the converter explicitly throws a ValidationError, the route doesn't match.
                                                // thus, we need to keep searching for the correct route.
                                                callback = undefined;
                                                continue searchWithinPrefix;
                                            } else if (ex instanceof escort.CasingError) {
                                                unconvertedValue = ex.expectedCasing;
                                                convertedValue = converters[k](unconvertedValue); // guaranteed not to error
                                            } else {
                                                throw ex;
                                            }
                                        }
                                        properUrl += unconvertedValue;
                                        properUrl += literals[k + 1] || "";
                                        params[argumentNames[k]] = convertedValue;
                                    }
                                    if (route.hasEndingSlash) {
                                        properUrl += "/";
                                    }
                            
                                    if (actualUrl !== properUrl) {
                                        redirectCache[actualUrl] = properUrl;
                                        movedPermanently(response, properUrl + querystring);
                                        return;
                                    }
                                    
                                    // params needs to be frozen since it will be potentially used in later requests through the dynamic route caching system
                                    freeze(params);
                                    dynamicRouteCache[actualUrl] = {
                                        descriptor: descriptor,
                                        params: params
                                    };
                                    
                                    // we're done, so we need to break out of the outer for loop
                                    break searchDynamicRoutes;
                                }
                            }
                        }
                    }
                    
                    if (!callback) {
                        // route was unable to be located
                        if (notFoundHandler) {
                            notFoundHandler(request, response, next);
                        } else {
                            next();
                        }
                        return;
                    }
                    
                    // set params on request as well as pass it into the callback.
                    request.params = params;
                    // the descriptor is passed in as "this" so that the user can do this.post(request, response) from their get callback.
                    callback.call(descriptor, request, response, params, !notFoundHandler ? next : function (err) {
                        if (err) {
                            next(err);
                        } else {
                            notFoundHandler(request, response, next);
                        }
                    });
                } catch (err) {
                    next(err);
                }
            }
424720
def post(self, query):
        
        res, response = self._do_post(query)
        cookies = res.getheader('Set-Cookie', None)
        if len(response) == 0 and cookies is not None and res.status == 200:
            logging.debug('Got 0-length 200 response with Set-Cookies header; '
                          'retrying request with cookies')
            _, response = self._do_post(query, [('Cookie', cookies)])
        return response
516671
function queryParser( req, res, next ) {
	if ( !req.query ) {
		var val = parseUrl( req ).query;
		req.query = queryparse( val );
	}
	next();
}
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()
1104079
function makeHttpRequest(next) {
  var start = Date.now();

  request({
    url: 'http://localhost:1337/upper',
    method: 'POST',
    headers: {
      'x-to-reverse': 'hi'
    },
    qs: {
      page: 13
    },
    body: 'goodbye-world'
  }, function(err, data, body) {
    var time = Date.now() - start;

    var filteredHeaders = _.pick(data.headers, 'x-reversed');
    console.log('FROM REQUEST');
    console.log('  status :', data.statusCode);
    console.log('  headers:', JSON.stringify(filteredHeaders));
    console.log('  body   :', body);
    console.log('  time   :', time);

    common.verify(function() {
      filteredHeaders.should.eql({ 'x-reversed': 'ih' });
      JSON.parse(body).should.eql({ data: 'GOODBYE-WORLD' });
      common.shouldBeDynamicallyTimed(time);
    });

    console.log();

    next();
  });
}
1009284
function (next) {
                request(url, function (err, res, body) {
                    if (err) {
                        return next(err);
                    }
                    next(null, body);
                });
            }
1098688
def _send_request(self, method, params=[], is_subscribe = False):
        '''
            
        '''
        # pick a new ID
        self.next_id += 1
        req_id = self.next_id

        # serialize as JSON
        msg = {'id': req_id, 'method': method, 'params': params}

        # subscriptions are a Q, normal requests are a future
        if is_subscribe:
            waitQ = asyncio.Queue()
            self.subscriptions[method].append(waitQ)

        fut = asyncio.Future(loop=self.loop)

        self.inflight[req_id] = (msg, fut)

        # send it via the transport, which serializes it
        if not self.protocol:
            logger.debug("Need to reconnect to server")

            async def connect_first():
                await self.reconnect()
                self.protocol.send_data(msg)

            self.loop.create_task(connect_first())
        else:
            # typical case, send request immediatedly, response is a future
            self.protocol.send_data(msg)

        return fut if not is_subscribe else (fut, waitQ)
368006
def _next_page(self):
        
        if not self._more_results:
            return None

        query_pb = self._build_protobuf()
        transaction = self.client.current_transaction
        if transaction is None:
            transaction_id = None
        else:
            transaction_id = transaction.id
        read_options = helpers.get_read_options(self._eventual, transaction_id)

        partition_id = entity_pb2.PartitionId(
            project_id=self._query.project, namespace_id=self._query.namespace
        )
        response_pb = self.client._datastore_api.run_query(
            self._query.project, partition_id, read_options, query=query_pb
        )
        entity_pbs = self._process_query_results(response_pb)
        return page_iterator.Page(self, entity_pbs, self.item_to_value)
839515
function(request, response, next){
		if (!utils.Misc.isNullOrUndefined(request.user) || request.originalUrl == '/error' || request.originalUrl.indexOf('/error?') == 0) {
			next();
		}
		else {
			var success = encodeURIComponent(request.protocol + '://' + request.get('host') + request.originalUrl);
			response.redirect('/login?success=' + success + '&no_query=true'); //we don't want it to add any query string
		}
	}
1154201
function pages(req, res, next) {

    generator.getPage(req.url, function(err, page) {

      if (err || !page || !checkMethod(req, page)) return next();

      if (!isPageAuthorized(req, page)) {
        if (!server.login || page.nologin) return next();
        return server.login(req, res);
      }

      debug('page %s', page._href);

      // make req and res available to dynamic pages
      generator.req = req;
      generator.res = res;

      resHeaders(res, page);
      res.send(generator.renderDoc(page));

    });
  }