Zend\Diactoros\Request::__construct PHP Method

__construct() public method

public __construct ( null | string | Psr\Http\Message\UriInterface $uri = null, null | string $method = null, string | resource | Psr\Http\Message\StreamInterface $body = 'php://temp', array $headers = [] )
$uri null | string | Psr\Http\Message\UriInterface URI for the request, if any.
$method null | string HTTP method for the request, if any.
$body string | resource | Psr\Http\Message\StreamInterface Message body, if any.
$headers array Headers for the message, if any.
    public function __construct($uri = null, $method = null, $body = 'php://temp', array $headers = [])
    {
        $this->initialize($uri, $method, $body, $headers);
    }

Usage Example

Example #1
0
 /**
  * @param null|string                     $uri     URI for the request, if any.
  * @param null|string                     $method  HTTP method for the request, if any.
  * @param string|resource|StreamInterface $body    Message body, if any.
  * @param array                           $headers Headers for the message, if any.
  *
  * @throws \InvalidArgumentException for any invalid value.
  */
 public function __construct($uri = null, $method = null, $body = 'php://input', array $headers = [])
 {
     parent::__construct($uri, $method, $body, $headers);
 }
All Usage Examples Of Zend\Diactoros\Request::__construct