When php performs WeChat text security verification, it always prompts that the data format is incorrect. Please give me an answer.
P粉821173971
P粉821173971 2022-11-01 10:25:02
0
0
989

Code:

$text=$_GET['text'];//Text content

$data = array(

'openid'=>$ openid,

'content'=>$text,

'version'=>2,

'scene'=>3

);

$data = http_build_query($data);

$url = 'https://api.weixin.qq.com/wxa/msg_sec_check?access_token='.$access_token;

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url);

curl_setopt($ch,CURLOPT_HEADER,0);

curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch, CURLOPT_POST, 1);//POST submission

curl_setopt($ch,CURLOPT_POSTFIELDS,$data);/ /POST data

$result = curl_exec($ch);

echo $result;

curl_close($ch);

Output result:

data: {errcode: 47001, errmsg: "data format error rid: 63608120-7a9be7c8-1bf52c51"}

P粉821173971
P粉821173971

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template