Open l0gicgate opened 5 years ago
$body = (new StreamFactory())->createStreamFromFile('php://input');
$body = (new StreamFactory())->createStreamFromFile('php://input');
We need to do this in addition to parsing the bodies different content types.
@l0gicgate i try to create a PR, but its hard to test (php://input) is not writeable
@l0gicgate adding php://input and use it for parsed body are two topics, please fix one after the other, cause parsed body from php://input it not a hard requirement for psr-message
@dominikzogg I'm fine with adding a stream wrapper dev dependency like https://packagist.org/packages/mikey179/vfsStream for unit testing so we can wrap it and test it.
@l0gicgate i didn't find any working example mocking php://input with vfsStream
Slim 4 has this feature already included in the BodyParsingMiddleware: https://github.com/slimphp/Slim/blob/4.x/Slim/Middleware/BodyParsingMiddleware.php
Do we really want to maintain the same feature 3 times? (1. slim/slim, 2. slim/http and now also in 3. slim/psr7)
Currently we do not parse any incoming data in the
Request
object. All that functionality has been moved to theSlim-Http
decorators repository.We should by default at least support the incoming form data in the
$_POST
object and JSON.