slimphp / Slim-Psr7

PSR-7 implementation for use with Slim 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add body parsing functionality in Request object

l0gicgate opened this issue · comments

Currently we do not parse any incoming data in the Request object. All that functionality has been moved to the Slim-Http decorators repository.

We should by default at least support the incoming form data in the $_POST object and JSON.

$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