PSR-7
PSR-7
Standard of the PHP Framework Interop Group that defines common interfaces for handling HTTP messages.
Psr\Http\Message\MessageInterface
Psr\Http\Message\RequestInterface
Psr\Http\Message\ResponseInterface
Psr\Http\Message\ServerRequestInterface
Psr\Http\Message\StreamInterface
Psr\Http\Message\UploadedFileInterface
Psr\Http\Message\UriInterface
Example:
PHP | |
---|---|
Immutability
PSR-7 requests are immutable objects; a change in the data will return a new instance of the object. The stream objects of PSR-7 are not immutable.