I am refactoring my application using PSR-7 Requests using Slim3 as Router. On some of my entry points I have incoming GET and POST HTTP-Requests from external applications. Both GET and POST use the same parameter names. In the old code, a simple $_REQUEST
solved the issue, but I do not want to use the superglobals any longer.
For getting the parameters of the GET-Request, I use the following code:
$parameters = $request->getQueryParams();
For the POST-Request, I use:
$parameters = $request->getParsedBody();
Is there a PSR-7 function for solving the issue, or do I have to use array_merge()
each time?