better get headers like it is done here: https://github.com/yiisoft/yii2/blob/master/extensions/debug/panels/RequestPanel.php#L39
Note that getallheaders is an alias for apache_request_headers() https://php.net/manual/de/function.getallheaders.php