微信小程序 post请求服务器接收不到参数

解决办法:加上 "Content-Type": "application/x-www-form-urlencoded"

wx.request({
            
            url: 'https://....php',
            header: {
              "Content-Type": "application/x-www-form-urlencoded"
            },
            data: {
              'data': '888',
            },
            method: 'POST',

            success:function(res){
             ...
            }
          })

其他办法:更改php接收该参数的方法: http://www.wxapp-union.com/forum.php?mod=viewthread&tid=2011

      修改服务器端代码:http://www.jianshu.com/p/f95f64b393d1

猜你喜欢

转载自blog.csdn.net/UFO00001/article/details/75072523