class ServerRequestFactory (View source)

Has the ability to create server requests.

Methods

ServerRequestInterface
createServerRequest(string $method, UriInterface|string $uri, array $serverParams = [])

Create a new server request.

Details

ServerRequestInterface createServerRequest(string $method, UriInterface|string $uri, array $serverParams = [])

Create a new server request.

Note that server parameters are taken precisely as given - no parsing/processing of the given values is performed. In particular, no attempt is made to determine the HTTP method or URI, which must be provided explicitly.

Parameters

string $method The HTTP method associated with the request.
UriInterface|string $uri The URI associated with the request.
array $serverParams An array of Server API (SAPI) parameters with which to seed the generated request instance.

Return Value

ServerRequestInterface