-
Notifications
You must be signed in to change notification settings - Fork 1
ServerRequestFactory: createServerRequest Example
Terry L edited this page Jun 21, 2020
·
6 revisions
Shieldon\Psr17\ServerRequestFactory
Create a new server request.
-
param
stringmethod*The HTTP method associated with the request. -
param
UriInterface|stringuri*The URI associated with the request. -
param
arrayserverParams= []An array of Server API (SAPI) parameters with which to seed the generated request instance. -
return
ServerRequestInterface
Examples:
$serverRequestFactory = new ServerRequestFactory();
$method = 'GET';
$url = 'https://www.yourwebsite.com/current-page/';
$serverRequest = $serverRequestFactory->createServerRequest($method, $uri);composer require shieldon/psr-httpShieldon PSR HTTP implementation written by Terry L. from Taiwan.
