Skip to content

Request: __construct Example

Terry L edited this page Jun 20, 2020 · 2 revisions

Shieldon\Psr7\Request

Extends Message.

__construct($method, $uri, $body, $headers, $version)

  • param string method = "GET" Request HTTP method.
  • param string|UriInterface uri = "" Request URI object URI or URL.
  • param string|StreamInterface body = "" Request body - see setBody()
  • param array headers = [] Request headers.
  • param string version = "1.1" Request protocol version.

Example:

$request = new \Shieldon\Psr7\Request('GET', 'https://www.example.com');
Clone this wiki locally