I am trying to access headers (field authorization) from a POST method, but it's never set.
according to
foreach (getallheaders() as $name => $value) {
echo "$name: $value\n";
}
the field "Authorization" is present (sent with postman)
however this evaluates to false
$authHeader = $_SERVER['HTTP_AUTHORIZATION'];
if (isset($authHeader))
{
echo "header field present";
}
else
{
echo "header field NOT present";
}
I am running Apache/PHP/MySql locally on Windows 10 PHP Version is 7.3.7 Apache/2.4.39 (Win64) OpenSSL/1.1.1c PHP/7.3.7
In Postman, I am passing "Content-Type=application/json" and "Authorization=Bearer..."
What's wrong here?