Is there any way to tell Slim 4 to not automatically parse the body of a POST request in “application/x-www-form-urlencoded” format?
I’m asking because I had to implement a middleware to parse the same for a PUT request, which is not automatically done, and ended up moving to JSON instead. So finally I have a middleware which parses the body if in “application/json” format.
The problem is that now $request->getParsedBody() returns the parsed body no matter if in urlencode or JSON format (because some underlying middleware is parsing the body if urlencoded). So the APIs now can understand both.
I’d like to limit the APIs to accept requests with bodies only in JSON format. Is it possible to disable the default behavior?