How PSR-7 Request works?

968 Views Asked by At

I'm confused about how PSR-7 based request works.

As PSR-7, a request must implement Psr\Http\Message\RequestInterface. By this interface a request must have a body and it must return body as an object that implements StreamInterface.

When I look at the StreamInterface, its more about to handling resources.

When I look at laravel's or symfony's requests, all those have server, get, post and cookie params. There is no request body or something similar.

First why a request must have a body (like a response) and why a request body must contains a resource and how?

0

There are 0 best solutions below