Skip to content

PSR 17: RequestFactory Example

Terry L edited this page Jun 21, 2020 · 3 revisions

PSR 17 Factories

Namespace

Shieldon\Psr17\RequestFactory

RequestFactory

__construct

None

createRequest($method, $uri)

  • param string method * The HTTP method associated with the request.
  • param UriInterface|string uri * The URI associated with the request.
  • return RequestInterface

Example:

use Shieldon\Psr17\RequestFactory;

$requestFactory = new RequestFactory();
$request = $requestFactory->createRequest('GET', 'https://www.google.com');
Clone this wiki locally