PSR standards · Question 3 of 12
Which PSR-7 interface describes an HTTP request received by the server, including cookies, query parameters and uploaded files?
1 answer is correct. Easy
Show answer
Answer
- A ServerRequestInterface
Explanation
The ServerRequestInterface extends the more general RequestInterface with everything that is only known on the server: server parameters, cookies, query parameters, the parsed body, uploaded files and attributes. RequestInterface alone describes an outgoing request, such as one an HTTP client sends to a third-party API. MessageInterface is the common base of request and response with headers and body, and UriInterface only represents the address. In TYPO3, middlewares and controllers receive the current request as a ServerRequestInterface, for example to read the GET parameters with getQueryParams().