although the headers attribute are public.
Because they are public. Just access them through the property directly:
$request->headers->get('Content-Type');
The request header collection is an instance of Symfony\Component\HttpFoundation\HeaderBag
, the response headers are contained in a Symfony\Component\HttpFoundation\ResponseHeaderBag
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With