php-fig/fig-standards — pull request #338 by weierophinney (2014-09-30 22:29:02+00:00)
Title: [PSR-7] Describe an Incoming Request

This pull request defines an additional interface for PSR-7, the Incoming Request. For server-side applications, a number of request sources are commonly required in order to handle the incoming request, including deserialized query string arguments, deserialized message body parameters (if any), and file upload metadata. These are commonly available via `$_GET`, `$_POST`, and `$_FILES`, although situations exist when those are not present and/or usable (e.g., during testing; when dispatching sub-requests; in cases where a non-POST HTTP method with a message body is present; and in cases where an incoming HTTP message body is present but not in a form-encoded content type).

The new interface, `Psr\Http\Message\IncomingRequestInterface`, extends the `Psr\Http\Message\RequestInterface`, and describes accessors and mutators for each of these, with accessors being the common API for consumers, and mutators being present for those marshaling request data from the request environment or those testing applications.

The following methods are defined:

- `getQueryParams()`
- `setQueryParams(array $params)`
- `getBodyParams()`
- `setBodyParams(array $params)`
- `getIncomingFiles()`
- `setIncomingFiles(array $files)`