I want send headers with curl to https site to get user info . but nothing return . i change headers but not work :( . but when i use this site for online request work right . below is my code
$api_url = 'https://api.fax.ir/v1/accounts/selfe';
$accessToken = get_option('faxir_access_token');
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer '.$accessToken,
'x-faxir-clientid: '.$this->client_id
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_VERBOSE,1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
I know maybe headers set is incorect but i don know how change header? i googled and test many ways but all not work :( . sorry for my poor english .
- top code return nothing .