Anyone knows about PSR-7?

Read https://habrahabr.ru/post/258423/ and https://habrahabr.ru/post/250343/ know what the standard is used in SlimFramework, AuraRouter, etc. but some questions are still not released:
1. Than not satisfied with the current titles, why should they be rolled into the objects?
2. A few examples from the article:
//define a new header will create new message object
$new = $message->withHeader('Location', 'http://example.com');

//if you need to update the value, you can override it:
$message = $message->withHeader('Location', 'http://example.com');

//if you want to add another value to the existing header:
$message = $message->withAddedHeader('X-Foo', 'bar');

//or even remove the title:
$message = $message->withoutHeader('X-Foo');

//explanatory phrase, for it provides the interface mutator withStatus():
$response = $response->withStatus(418, "I'm a teapot");

I'm certainly a noob, but can you give me simple human language to explain where and why you want to rewrite the headers, remove them, add values, and add an explanatory phrase?
July 8th 19 at 16:28
1 answer
July 8th 19 at 16:30
I'm certainly a noob, but can you give me simple human language to explain where and why you want to rewrite the headers, remove them, add values, and add an explanatory phrase?


Mallery. For example, you can add headers to support CORS. In the end, will know just a little add-on to the system and not the whole system. For example, authentication.

The actual problem is very different can be, so the possibility of this need to give.

Find more questions by tags PHP