下面是我的程序代码,打印$getwxacodeunlimit的值一直为null
<?php
$data=['scene'=>'test=1','width'=>430];
$data=json_encode($data);
$getwxacodeunlimit=$this->https_request($this->getwxacodeunlimit,$data);
var_dump($getwxacodeunlimit);die;
function https_request($url,$data=null){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
if($data){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
$result = curl_exec($ch);
$info = json_decode($result);
curl_close($ch); //释放资源
return $info;
}
接口正常返回二进制数据,你还用json_decode?