Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add body parsing functionality in Request object #97

Open
l0gicgate opened this issue May 20, 2019 · 9 comments
Open

Add body parsing functionality in Request object #97

l0gicgate opened this issue May 20, 2019 · 9 comments

Comments

@l0gicgate
Copy link
Member

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.

@dominikzogg
Copy link
Contributor

$body = (new StreamFactory())->createStreamFromFile('php://input');

@l0gicgate
Copy link
Member Author

$body = (new StreamFactory())->createStreamFromFile('php://input');

We need to do this in addition to parsing the bodies different content types.

@dominikzogg
Copy link
Contributor

@l0gicgate i try to create a PR, but its hard to test (php://input) is not writeable

@dominikzogg
Copy link
Contributor

@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

@l0gicgate
Copy link
Member Author

l0gicgate commented Aug 1, 2019

@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.

@dominikzogg
Copy link
Contributor

@l0gicgate i didn't find any working example mocking php://input with vfsStream

@dominikzogg
Copy link
Contributor

#110

@dominikzogg
Copy link
Contributor

@odan
Copy link

odan commented Jul 10, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants