Request: __construct Example
Terry L edited this page Jun 20, 2020
·
2 revisions
Pages 111
Clone this wiki locally
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');
Install
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.