Webiny\Component\Http\Request::header PHP Method

header() public method

Get a value from HTTP Headers If key doesn't not exist, $value will be returned and assigned under that key.
public header ( string $key = null, mixed $value = null ) : mixed
$key string Key for which you wish to get the value.
$value mixed Default value that will be returned if $key doesn't exist.
return mixed Value of the given $key.
    public function header($key = null, $value = null)
    {
        return $this->isNull($key) ? $this->headers->getAll() : $this->headers->get($key, $value);
    }