好的,因此连接此API的说明如下:
curl -X GET "https://api.xxxxxxxxxxx.com/jobs?limit=10&offset=0" -H "accept: application/json" -H "X-SmartToken: xxxxxxxxxxxxx"
所以我的PHP如下所示,但是我得到了这个 [message] =>身份验证数据丢失
$token = "xxxxxxxxxxxxx";
$url = "https://api.xxxxxxx.com/jobs?limit=10&offset=0";
header('Content-Type: application/json');
$ch = curl_init($url);
$authorization = "Authorization: X-SmartToken ".$token;
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-Type: application/json',$authorization ));
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
$result = curl_exec($ch);
curl_close($ch);
print_r(json_decode($result));
exit;
有人看到我在做什么错吗?
谢谢