0

I've read about the PSR-7 but I simply couldn't understand how to implement it. Here's one example of something I did not understand:

The withHeader method would call a header() function? If so, how do I implement the withoutHeader method? If thats not the time and place to call header(), where (and when) is it?

Thank you all in advance.

Vinicius Dias
  • 664
  • 3
  • 15
  • you can use some library that already implement that standard for you, i.e https://github.com/guzzle/psr7 – Federkun Dec 05 '16 at 11:48
  • and no, that's a HTTP message standard, the `header` function has [no use here](http://s2.quickmeme.com/img/09/092556c9ea57329eefdbdd772f591c36f8d34758ee16379ae9a007c524c2afad.jpg). – Federkun Dec 05 '16 at 11:50
  • Isn't the `header` function that appends a HTTP Header to the response? I'm completely in the dark here. – Vinicius Dias Dec 05 '16 at 11:54
  • let's say that you implemented the `Psr\Http\Message\RequestInterface` contract. how can I send it to the client? with something like this: https://github.com/slimphp/Slim/blob/3.x/Slim/App.php#L349 – Federkun Dec 05 '16 at 12:06
  • It uses the `header` function. – Vinicius Dias Jan 23 '17 at 16:59

1 Answers1

0

I read the code of symfony/http-foundation and it all became clear. If anyone has the same doubt I recommend seeing it.

Vinicius Dias
  • 664
  • 3
  • 15