收藏
回答

关于updatablemsg接口问题

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug updatablemsg 客户端 6.70 2.4
$url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/updatablemsg/send?access_token='.$token['data']->access_token;
 
        $post_data = array(
 
            "activity_id" =>$actId,
 
            "target_state"=>(count($openids)>=$max?1:0),
 
            "template_info"=>array(
 
                "parameter_list"=>array(
 
                    array('name'=>'member_count','value'=>count($openids)),
 
                    array('name'=>'room_limit','value'=>$max),
 
                    array('name'=>'path','value'=>'?actId='.$actId),
 
                    array('name'=>'version_type','value'=>'develop')
 
                )
 
            )
 
        );
 
         
 
        $ch = curl_init();
 
        $j= json_encode($post_data);
 
 
 
         
 
        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
 
            'Content-Type: application/json',
 
            'Content-Length: ' . strlen($j)));
 
 
 
        curl_setopt($ch, CURLOPT_URL, $url);
 
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 
 
 
        curl_setopt($ch, CURLOPT_POST, 1);
 
         
 
        curl_setopt($ch , CURLOPT_POSTFIELDS,$j);
 
        $result = curl_exec($ch);
 
        echo json_encode($result);
 
        curl_close($ch);




为什么死活提示post数据为空?

最后一次编辑于  2018-11-19
回答关注问题邀请回答
收藏

1 个回答

  • 2018-11-19

    。。。。自己解决了,member_count和room_limit的value不能为数字...要转成字符....不然提示44002(post数据为空错误)....我砸,这明明不是数据为空的问题,干嘛提示44002,坑死了,误导....


    2018-11-19
    有用
    回复
登录 后发表内容