调用getwxacodeunlimit接口,返回数据为空,又不报错,请问是怎么回事,用postman测试是有数据返回的。
$curl = curl_init();
//设置curl选项
curl_setopt($curl,CURLOPT_URL,$url);//URL
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,false);
//}
// 处理post相关选项
curl_setopt($curl,CURLOPT_POST,TRUE);
curl_setopt($curl,CURLOPT_POSTFIELDS,$data);
curl_setopt($curl,CURLOPT_HEADER,TRUE);
curl_setopt($curl, CURLOPT_NOBODY, FALSE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
// 发出请求
$res = curl_exec($curl);
if(false === $response)
{
return false;
}
$error = curl_errno($curl);
$httpinfo = curl_getinfo($curl);
curl_close($curl);
return array(
‘response’ => $res,
‘error’ => $error,
‘httpinfo’ => $httpinfo
);