CURLOPT_HEADER TRUE to include the header in the output, so it not for sending custom headers. you can set it to false and remove the loop
foreach($output as $line)
{
if($line === false)
{
// there was no bearer token
}else{
$bearer_token = $line;
}
}
CURLOPT_HEADERTRUE to include the header in the output, so it not for sending custom headers. you can set it to false and remove the loop