请求
@param  IRequest $request [description]
@return [type]            [description]
771069
public function execute(IRequest $request)
    {
        $action    = $request->getAction();
        $reqParams = $request->getParams();
        $pubParams = $this->getPublicParams();

        $params = array_merge(
            $pubParams,
            ['Action' => $action],
            $reqParams
        );


        // 签名
        $params['Signature'] = $this->generateSign($params);

        // 请求数据
        $resp = $this->curl(
            $this->api_uri,
            $params
        );

        return json_decode($resp);
    }
217243
public function match(Request $request): array
    {
        $uri = $request->getUri()->getPath();

        // HTTP & WebSocket 请求
        if ($request->getProtocol() === Protocol::HTTP || $request->getProtocol() === Protocol::WEBSOCKET) {
            return $this->getDispatcher()->dispatch(
                $request->getMethod(),
                $uri
            );
        } else { // TCP & UDP 请求
            foreach (['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTION'] as $method) {
                $route = $this->getDispatcher()->dispatch($method, $uri);

                if ($route[0] === self::FOUND) {
                    return $route;
                }

                unset($route);
            }

            return [ self::NOT_FOUND ];
        }
    }
774359
protected function resolveRequestSignature($request)
    {
        return sha1(
            $request->method() .
            '|' . $request->server('SERVER_NAME') .
            '|' . $request->path() .
            '|' . $request->ip()
        );
    }
1012060
protected function getRequestOrigin(HTTPRequest $request)
    {
        // Prefer Origin header
        $origin = $request->getHeader('Origin');
        if ($origin) {
            return $origin;
        }

        // Check referer
        $referer = $request->getHeader('Referer');
        if ($referer) {
            // Extract protocol, hostname, and port
            $refererParts = parse_url($referer);
            if (!$refererParts) {
                return null;
            }
            // Rebuild
            $origin = $refererParts['scheme'] . '://' . $refererParts['host'];
            if (isset($refererParts['port'])) {
                $origin .= ':' . $refererParts['port'];
            }
            return $origin;
        }

        return null;
    }
629127
protected function getFile($request)
    {
        $columns = explode('.',$this->options['column']);
        $column = count($columns) > 1 ? $columns[1] : $columns[0];
        $inputName = isset($this->options['group'])
            ? "{$this->options['group']}.{$this->options['index']}.{$column}"
            : $column;
        $inputName = isset($this->options['inputPrefix']) && $this->options['inputPrefix'] ? $this->options['inputPrefix'] . $inputName : $inputName;
        if ( isset($this->options['isElfinder']) && $this->options['isElfinder'] ) {
            $file = $request->input($inputName);
            $this->elfinderFilePath = public_path($file);
        } else {
            $file = $request->file($inputName);
            // eğer dosya yoksa init var mı bakılır
            if (! $file || (is_array($file) && array_search(null,$file) !== false) ) {
                $column  = 'init_';
                $column .= count($columns) > 1 ? $columns[1] : $columns[0];
                $file = $request->get($column);
            }
        }
        return is_array($file) ? $file : [$file];
    }
989759
public function cgetAction(Request $request)
    {
        $locale = $this->getLocale($request);

        // if the type parameter is falsy, assign NULL to $type
        $type = $request->query->get('type', null) ?: null;

        $idsString = $request->get('ids');

        if ($idsString) {
            $ids = explode(',', $idsString);
            $snippets = $this->snippetRepository->getSnippetsByUuids($ids, $locale);
            $total = count($snippets);
        } else {
            $snippets = $this->snippetRepository->getSnippets(
                $locale,
                $type,
                $this->listRestHelper->getOffset(),
                $this->listRestHelper->getLimit(),
                $this->listRestHelper->getSearchPattern(),
                $this->listRestHelper->getSortColumn(),
                $this->listRestHelper->getSortOrder()
            );

            $total = $this->snippetRepository->getSnippetsAmount(
                $locale,
                $type,
                $this->listRestHelper->getSearchPattern(),
                $this->listRestHelper->getSortColumn(),
                $this->listRestHelper->getSortOrder()
            );
        }

        $data = new ListRepresentation(
            $snippets,
            'snippets',
            'get_snippets',
            $request->query->all(),
            $this->listRestHelper->getPage(),
            $this->listRestHelper->getLimit(),
            $total
        );

        return $this->viewHandler->handle(View::create($data));
    }
1351174
private function createRpbMessage(GetRequest $request)
    {
        $message = new RpbGetReq();

        $message->setBucket($request->bucket);
        $message->setType($request->type);
        $message->setKey($request->key);

        if ($request->r !== null) {
            $message->setR($this->encodeQuorum($request->r));
        }

        if ($request->pr !== null) {
            $message->setPr($this->encodeQuorum($request->pr));
        }

        if ($request->basicQuorum !== null) {
            $message->setBasicQuorum($request->basicQuorum);
        }

        if ($request->notfoundOk !== null) {
            $message->setNotfoundOk($request->notfoundOk);
        }

        return $message;
    }
125674
function parseRequest($request)
    {
        $url_info = parse_url($request->meta['uri']);
        $request->meta['path'] = $url_info['path'];
        if (isset($url_info['fragment'])) $request->meta['fragment'] = $url_info['fragment'];
        if (isset($url_info['query']))
        {
            parse_str($url_info['query'], $request->get);
        }
        //POST请求,有http body
        if ($request->meta['method'] === 'POST')
        {
            $this->parser->parseBody($request);
        }
        //解析Cookies
        if (!empty($request->header['Cookie']))
        {
            $this->parser->parseCookie($request);
        }
    }
204472
public function doRequest($request)
    {
        $inputStream = fopen('php://memory', 'r+');
        $content = $request->getContent();
        if ($content !== null) {
            fwrite($inputStream, $content);
            rewind($inputStream);
        }

        $queryParams = [];
        $postParams = [];
        $queryString = parse_url($request->getUri(), PHP_URL_QUERY);
        if ($queryString != '') {
            parse_str($queryString, $queryParams);
        }
        if ($request->getMethod() !== 'GET') {
            $postParams = $request->getParameters();
        }

        $serverParams = $request->getServer();
        if (!isset($serverParams['SCRIPT_NAME'])) {
            //required by WhoopsErrorHandler
            $serverParams['SCRIPT_NAME'] = 'Codeception';
        }
        
        $cookies = $request->getCookies();
        $headers = $this->extractHeaders($request);

        //set cookie header because dflydev/fig-cookies reads cookies from header
        if (!empty($cookies)) {
            $headers['cookie'] = implode(';', array_map(function ($key, $value) {
                return "$key=$value";
            }, array_keys($cookies), $cookies));
        }

        $zendRequest = new ServerRequest(
            $serverParams,
            $this->convertFiles($request->getFiles()),
            $request->getUri(),
            $request->getMethod(),
            $inputStream,
            $headers,
            $cookies,
            $queryParams,
            $postParams
        );

        $this->request = $zendRequest;

        $cwd = getcwd();
        chdir(codecept_root_dir());

        if ($this->config['recreateApplicationBetweenRequests'] === true || $this->application === null) {
            $application = $this->initApplication();
        } else {
            $application = $this->application;
        }

        if (method_exists($application, 'handle')) {
            //Zend Expressive v3
            $response = $application->handle($zendRequest);
        } else {
            //Older versions
            $application->run($zendRequest);
            $response = $this->responseCollector->getResponse();
            $this->responseCollector->clearResponse();
        }

        chdir($cwd);

        return new Response(
            (string)$response->getBody(),
            $response->getStatusCode(),
            $response->getHeaders()
        );
    }
356015
public function render($request)
    {
        if ($request->wantsJson()) {
            return $this->validInternalServerErrorJsonResponse($this, $this->message);
        } else {
            return redirect()->back()->with(['rafflesargentina.status.error' => $this->message]);
        }
    }
1141790
public function parseQuery($request)
    {
        list($endpoint, $params) = explode('?', $request['request']['uri']);

        $request['endpoint'] = $endpoint;
        $request['params'] = $params;
        $request['method'] = $request['request']['method'];
        $request['raw_data'] = $request['request']['raw_data'];

        if (class_exists(VarCloner::class)) {
            $varCloner = new VarCloner();

            parse_str($params, $stub);
            $request['stub'] = Kernel::VERSION_ID >= 30200 ? $varCloner->cloneVar($stub) : $stub;
        }

        return $request;
    }
33945
public function match(Nette\Http\IRequest $httpRequest): ?Request
	{
		if (!$this->isHttpMethodSupported($httpRequest->getMethod())) {
			return NULL;
		}
		
		$path = $httpRequest->getUrl()->getPath();
		$matches = $this->pathMatcher->match($this->route, $path);
		
		if ($matches === null) {
			return null;
		}
		
		$params = array_merge($httpRequest->getQuery(), $matches);
		
		return new Request(
			$this->presenterClassName,
			$httpRequest->getMethod(),
			$params,
			$httpRequest->getPost(),
			$httpRequest->getFiles(),
			[Request::SECURED => $httpRequest->isSecured()]
		);
	}
422427
protected function executeRequest($request)
    {
        // 请求微信服务器
        $result = $this->request->curlPost($request->getRequestUrl(), $request->params());

        $result = (array)simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA);

        return $result;
    }
43985
protected function redirectTo($request)
    {
        session()->put('loginRedir', $_SERVER["REQUEST_URI"]);
        session()->put('loginRedirTime', time());
        if (!$request->expectsJson()) {
            return route('login');
        }
    }
229660
public function makeRequest($request)
    {
        $optionsSet = curl_setopt_array($this->ch, [
            CURLOPT_URL => $this->url,
            CURLOPT_HEADER => false,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_CONNECTTIMEOUT => $this->timeout,
            CURLOPT_USERAGENT => 'JSON-RPC Random.org PHP Client',
            CURLOPT_HTTPHEADER => $this->headers,
            CURLOPT_FOLLOWLOCATION => false,
            CURLOPT_CUSTOMREQUEST => 'POST',
            CURLOPT_SSL_VERIFYPEER => $this->verifyPeer,
            CURLOPT_POSTFIELDS => json_encode($request)
        ]);

        if (!$optionsSet) {
            throw new \Exception('Cannot set curl options');
        }

        $responseBody = curl_exec($this->ch);
        $responseCode = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);

        if (curl_errno($this->ch)) {
            throw new \RuntimeException(curl_error($this->ch));
        }

        if ($responseCode === 401 || $responseCode === 403) {
            throw new \RuntimeException('Access denied');
        }

        $response = json_decode($responseBody, true);

        if ($this->debug) {
            echo('==> Request: '.PHP_EOL.json_encode($request, JSON_PRETTY_PRINT));
            echo('==> Response: '.PHP_EOL.json_encode($response, JSON_PRETTY_PRINT));
        }

        return $response;
    }
209205
public function cgetAction(Request $request)
    {
        $filter = $this->getManager()->getFilters($request);
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));

        if ($request->get('flat') == 'true') {
            $filterFieldDescriptors = $this->getManager()->getFilterFieldDescriptors();
            $fieldDescriptors = $this->getManager()->getFieldDescriptors(
                $locale
            );

            $list = $this->flatResponse(
                $request,
                $filter,
                $filterFieldDescriptors,
                $fieldDescriptors,
                static::$entityName
            );
        } elseif ($request->get('ids') !== '') {
            $list = new CollectionRepresentation(
                $this->getManager()->findAllByIdsAndLocale($locale, $request->get('ids')),
                self::$entityKey
            );
        } else {
            $list = new CollectionRepresentation(
                $this->getManager()->findAllByLocale($locale, $filter),
                self::$entityKey
            );
        }

        $view = $this->view($list, 200);

        return $this->handleView($view);
    }
1129901
public function authenticate(IRequest $request)
    {
        $id = $request->request('client_id');
        $secret = $request->request('client_secret');

        if (!$id) {
            throw new InvalidClientException('Client id is missing.');
        }

        if (!$client = $this->clientStorage->get($id)) {
            throw new InvalidClientException('Invalid client credentials.');
        }

        if ((string) $secret !== (string) $client->getSecret()) {
            throw new InvalidClientException('Invalid client credentials.');
        }

        return $client;
    }