https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/sec-check/security.msgSecCheck.htmlhttps://developers.weixin.qq.com/miniprogram/product/
错误信息:{
"errcode": 47001,
"errmsg": "data format error rid: 6360a1e5-2dd908fb-06422df3"
}
老是这样。没有一次是成功过的
传的就不对,咋成功,token用query,其它参数用json
<?php
$txt=$_GET['txt'];
$encode = mb_detect_encoding($txt, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5','LATIN1'));
if($encode != 'UTF-8'){
$name = mb_convert_encoding($name, 'UTF-8', $encode);
}
$data = array(
"openid"=>"oQ64",
"scene"=>"2",
"version"=>'2',
//"access_token" => "我的密钥",
"content" => "内容你好",
);
$payload = json_encode($data,true);
$ch = curl_init("https://api.weixin.qq.com/wxa/msg_sec_check");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($payload))
);
$result = curl_exec($ch);
curl_close($ch);
print_r($result);