$headers
$headers :
HeaderBag is a container for HTTP headers.
get(string $key, string|array<mixed,string>|null $default = null, boolean $first = true) : string|array<mixed,string>|null
Returns a header value by name.
string | $key | The header name |
string|array<mixed,string>|null | $default | The default value |
boolean | $first | Whether to return the first value or all header values |
The first header value or default value if $first is true, an array of values otherwise
getDate(string $key, \DateTime $default = null) : null|\DateTime
Returns the HTTP header value converted to a date.
string | $key | The parameter key |
\DateTime | $default | The default value |
When the HTTP header is not parseable
The parsed DateTime or the default value if the header does not exist