收藏
回答

我怎么老是请求不了。老是不能成功

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"

}

老是这样。没有一次是成功过的

回答关注问题邀请回答
收藏

2 个回答

  • Mr.Zhao
    Mr.Zhao
    2022-11-01

    传的就不对,咋成功,token用query,其它参数用json

    2022-11-01
    有用
    回复
  • 名字先留着,以后再写
    名字先留着,以后再写
    2022-11-01

    <?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);

    2022-11-01
    有用
    回复
登录 后发表内容