调用图片验证接口失败?
发布于 5 年前 作者 shigang 14973 次浏览 来自 问答

api.weixin.qq.com/wxa/img_sec_check 接口调用后,一直接提示:

media data missing rid: 5ff815d8-41728925-6fb91bd0" 图片参数没有接收到

$res = self::post($url, ['media' => $_FILES['image']]);


$headers = ['Content-Type:application/json'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // 关键点
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE)); // 【* 关键点】
$res = curl_exec($ch);
curl_close($ch);


回到顶部