Construit une requête à partir des paramètre du serveur.

@return ServerRequest
4581
public static function create()
    {
        $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
        $scheme = isset($_SERVER[ 'HTTPS' ]) && ($_SERVER[ 'HTTPS' ] == 'on' || $_SERVER[ 'HTTPS' ] == 1) ||
            isset($_SERVER[ 'HTTP_X_FORWARDED_PROTO' ]) && $_SERVER[ 'HTTP_X_FORWARDED_PROTO' ] == 'https'
            ? 'https'
            : 'http';

        /* Construit le Uri de la requête */
        $uri      = Uri::create($scheme . '://' . $_SERVER[ 'HTTP_HOST' ] . $_SERVER[ 'REQUEST_URI' ]);
        $headers  = function_exists('getallheaders')
            ? getallheaders()
            : [];
        $protocol = isset($_SERVER[ 'SERVER_PROTOCOL' ])
            ? str_replace('HTTP/', '', $_SERVER[ 'SERVER_PROTOCOL' ])
            : '1.1';

        $request = new ServerRequest(
            $method,
            $uri,
            $headers,
            new Stream(),
            $protocol,
            $_SERVER,
            $_COOKIE,
            $_FILES
        );

        return $request->withParsedBody($_POST)
                ->withQueryParams($_GET);
    }
276901
public function createRequest() {
        $request = new \Amp\Artax\Request();
        $url = null;
        $request->setMethod('GET');

        $queryParameters = [];

        if (array_key_exists('Accept', $this->parameters) == true) {
        $value = $this->getFilteredParameter('Accept');
            $request->setHeader('Accept', $value);
        }
        $value = $this->getFilteredParameter('Authorization');
        if ($value != null) {
            $request->setHeader('Authorization', $value);
        }
        $value = $this->getFilteredParameter('userAgent');
        $request->setHeader('User-Agent', $value);
        if (array_key_exists('perPage', $this->parameters) == true) {
        $value = $this->getFilteredParameter('perPage');
            $queryParameters['per_page'] = $value;
        }
        if (array_key_exists('otp', $this->parameters) == true) {
        $value = $this->getFilteredParameter('otp');
            $request->setHeader('X-GitHub-OTP', $value);
        }
        $value = $this->getFilteredParameter('pageURL');
        $url = $value;

        //Parameters are parsed and set, lets prepare the request
        if ($url == null) {
            $url = "https://api.github.com";
        }
        if (count($queryParameters)) {
            $url = $url.'?'.http_build_query($queryParameters, '', '&', PHP_QUERY_RFC3986);
        }
        $request->setUri($url);

        return $request;
    }
1028156
public function getServer()
    {
        $server = new Server(
            $this->getSource(),
            $this->getCache(),
            $this->getApi()
        );

        $server->setSourcePathPrefix($this->getSourcePathPrefix());
        $server->setCachePathPrefix($this->getCachePathPrefix());
        $server->setGroupCacheInFolders($this->getGroupCacheInFolders());
        $server->setCacheWithFileExtensions($this->getCacheWithFileExtensions());
        $server->setDefaults($this->getDefaults());
        $server->setPresets($this->getPresets());
        $server->setBaseUrl($this->getBaseUrl());
        $server->setResponseFactory($this->getResponseFactory());

        return $server;
    }
639990
protected function newRequest()
    {
        $req = new \stdClass;
        $req->attrs = new \stdClass();
        $req->attrs->request = [];
        $req->attrs->get = [];
        $req->attrs->post = [];
        $req->attrs->cookie = [];
        $req->attrs->server = [];
        $req->attrs->files = [];
        $req->attrs->session = null;
        $req->attrs->paramsDone = false;
        $req->attrs->inputDone = false;
        $req->attrs->input = new Input();
        $req->attrs->inputReaded = 0;
        $req->attrs->chunked = false;
        $req->upstream = $this;
        return $req;
    }
125165
public function getRequest()
    {
        if (isset($_SERVER['REQUEST_METHOD'])) {
            return new PhpRequest(
                empty($_SESSION) ? [] : $_SESSION,
                empty($_COOKIE) ? [] : $_COOKIE,
                getallheaders(),
                $_SERVER,
                static::getInputParams($_SERVER, $_POST)
            );
        }

        return new NullRequest();
    }
1321740
public function buildStandardCheckoutRequest()
    {
        $this->addBaseParams();
        $this->addBasketParams();
        $this->addDescriptionParams();
        $this->disableSelectingDifferentAddressInPayPal();
        $this->setMaximumOrderAmount();

        if ($this->getShowCartInPayPal()) {
            $this->addBasketItemParams();
        } else {
            $this->addBasketGrandTotalParams();
        }
        $this->addAddressParams();

        return $this->getPayPalRequest();
    }
1214701
private function prepareRequest()
    {
        // Store id and request name.
        $storeId           = $this->getStoreId();
        $searchRequestName = $this->searchRequestName;

        // Pagination params.
        $size = $this->_pageSize ? $this->_pageSize : 0;
        $from = $size * (max(1, $this->_curPage) - 1);

        // Setup sort orders.
        $sortOrders = $this->prepareSortOrders();

        $searchRequest = $this->requestBuilder->create(
            $storeId,
            $searchRequestName,
            $from,
            $size,
            $this->query,
            $sortOrders,
            $this->filters,
            $this->queryFilters,
            $this->facets
        );

        return $searchRequest;
    }
552579
protected function buildRequest()
    {
        $request = new Request($this->helper());
        $request->setRouter($this->router());

        return $request;
    }
1223058
public function putRequest()
    {
        $operation = array(
            'API' => 'PutBucket',
            'Method' => 'PUT',
            'Uri' => '/<bucket-name>',
            'Headers' => array(
                'Host' => $this->properties['zone'] . '.' . $this->config->host,
            ),
            'Params' => array(
            ),
            'Elements' => array(
            ),
            'Properties' => $this->properties,
            'Body' => null
        );
        $this->putValidate($operation);
        $req = new Request($this->config, $operation);
        return $req;
    }
900289
public function serverAction()
    {
        chdir($this->application->config('directory.document_root'));
        $host = $this->request->get('host', 'localhost');
        $port = $this->request->get('port', 8888);
        passthru(sprintf('php -S %s:%s index.php', $host, $port));
    }
593735
public function createRequest()
    {
        if ($this->request == null){
            $this->request = Request::fromPhpContext($this);
        }

        return $this->request;
    }
1308755
public function createRequest()
    {
        return $this->httpClient->createRequest(
            $this->getMethod(),
            $this->getUrl(),
            $this->getPreparedHeaders(),
            $this->getPreparedData()
        );
    }
1286857
public function build(): GetRequestPostDataRequest
	{
		$instance = new GetRequestPostDataRequest();
		if ($this->requestId === null) {
			throw new BuilderException('Property [requestId] is required.');
		}
		$instance->requestId = $this->requestId;
		return $instance;
	}
1051653
private function getPsrRequest(Request $symfonyRequest): ServerRequestInterface
    {
        $psrRequest = $this->diactorosFactory->createRequest($symfonyRequest);
        $psrRequest = $psrRequest->withAttribute('request', $symfonyRequest);

        return $psrRequest;
    }
527666
protected function getServer()
    {
        $server = new Server();
        $server->setHost($this->getHost())
            ->setRoot($this->getServerRoot())
            ->setBranch($this->getServerBranch())
            ->setCodeVersion($this->getServerCodeVersion());
        $extras = $this->getServerExtras();
        if (!$extras) {
            $extras = array();
        }

        $server->setExtras($extras);
        if (isset($_SERVER) && array_key_exists('argv', $_SERVER)) {
            $server->setArgv($_SERVER['argv']);
        }
        return $server;
    }
962782
protected function makeRequest()
    {
        $requestType = trim(strtolower($this->getService('type')));
        if($this->getService('endpoint'))
            $this->requestUrl->appendPathSegment($this->getEndpoint());
        if($requestType != 'post' && $this->getParam())
            $this->requestUrl->setQueryFromArray($this->getParam());
        $this->requestUrl->setQueryParameter('key',$this->getApiKey());
        switch ($requestType){
            case 'POST':
                $postData = json_encode($this->getParam());
                break;
            case 'GET':
            default:
                break;
        }
        $request        = StreamClient::make()->{$requestType}($this->requestUrl->write());
        $responseBody   = $this->unserializeResponse($request->getBody());
        $responseStatus = $request->getStatusCode();
        switch($responseStatus){
            case 200:
                if($responseBody['status'] != self::STATUS_SUCCESS)
                    throw new \ErrorException($responseBody['status'].':'.$responseBody['error_message']);
                break;
            default:
                throw new \ErrorException($responseStatus.' '.$request->getReasonPhrase().':'.$responseBody['error_message']);
        }
        $checkClass = __NAMESPACE__."\Services\\".ucfirst($this->service);
        $this->responseBody = (Arr::has($responseBody,$this->getService(self::$responseKey))) ? Arr::get($responseBody,$this->getService(self::$responseKey)) : $responseBody;
        return (class_exists($checkClass)) ? new $checkClass($this) : $responseBody;
    }
539898
public function createServer(ServerRequestInterface $request): Server
    {
        if ($this->server === null) {
            $this->server = Server::createServerFromRequest(
                $this->config('middleware'),
                $request
            );
        } else {
            $this->server->setRequest($request);
        }

        $this->setRequest($request);

        return $this->server;
    }