微信小程序method:post报错

按照官方文档,我们客户端发起post请求的代码如下:

  t:function() {

  wx.request({

    url: url,

    data: {"text":"123"

   },

    method: 'POST', 

    success: function(res){

    console.log(JSON.stringify(res));

    }

   })

  },

然后一直报错

这时候你加上header: {"Content-Type":"application/x-www-form-urlencoded"},就不报错了

猜你喜欢

转载自blog.csdn.net/zhou_w_x/article/details/80566775
今日推荐