You are here

public function ServerRequest::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-diactoros/src/ServerRequest.php \Zend\Diactoros\ServerRequest::__construct()
  2. 8 vendor/symfony/psr-http-message-bridge/Tests/Fixtures/ServerRequest.php \Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\ServerRequest::__construct()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-diactoros/src/ServerRequest.php \Zend\Diactoros\ServerRequest::__construct()

Parameters

array $serverParams Server parameters, typically from $_SERVER:

array $uploadedFiles Upload file information, a tree of UploadedFiles:

null|string $uri URI for the request, if any.:

null|string $method HTTP method for the request, if any.:

string|resource|StreamInterface $body Message body, if any.:

array $headers Headers for the message, if any.:

Throws

InvalidArgumentException for any invalid value.

File

vendor/zendframework/zend-diactoros/src/ServerRequest.php, line 74

Class

ServerRequest
Server-side HTTP request

Namespace

Zend\Diactoros

Code

public function __construct(array $serverParams = [], array $uploadedFiles = [], $uri = null, $method = null, $body = 'php://input', array $headers = []) {
  $this
    ->validateUploadedFiles($uploadedFiles);
  $body = $this
    ->getStream($body);
  $this
    ->initialize($uri, $method, $body, $headers);
  $this->serverParams = $serverParams;
  $this->uploadedFiles = $uploadedFiles;
}