Nyholm / psr7-server

Helper classes to use any PSR7 implementation as your main request and response
MIT License
90 stars 21 forks source link

Should fromGlobals also set the HTTP request body? #15

Closed Zegnat closed 6 years ago

Zegnat commented 6 years ago

This is another thing developers likely want for the ServerRequest object: the request body. PHP puts this away in php://input. Currently you would need to pass a stream to the fromArrays method:

$requestBody = fopen('php://input', 'r');

Should fromGlobals be extended with something like “defaults to php://input as body”?

Nyholm commented 6 years ago

Yes. It should. I forgot about that when I was adding the body argument.

:+1: