I'm working with curl but I don't know how to get the bearer that returns when you make a request in postman it returns it here
How can I get the authorization in curl to make a new request with this authorization so I make the request
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL =>
"https://xxxxxxxx/rest/xxxxx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>
"xxx=xx&xx=xx&xx=xxx&xxxxx=xxxxxxx&undefined=",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer xxxxxx",
"Content-Type: application/x-www-form-urlencoded",
"cache-control: no-cache"
),
));
$responsess = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
How can I obtain the authorization bearer that returns this request in the headers?
in the curl array configuration I add CURLOPT_HEADER => true, and this returns the response with the headers