Skip to content

RequestFactory: createRequest Example

Terry L edited this page Jun 21, 2020 · 4 revisions
Clone this wiki locally

Shieldon\Psr17\RequestFactory

createRequest($method, $uri)

Create a new request.

  • 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');