这个坑真深…

一开始去请求线上接口,老是爆传的数据为空。刚开始怀疑写的方法有错,检查没错后,上服务器打印传过来的进日志,发现日志接受到参数为空,懵逼。

原来是wx.request默认header头部为:

headers: {      'Content-Type': 'application/json'    },

这种模式对于原来接口不能接收,后改为:

header: {          'content-type': 'application/x-www-form-urlencoded'        },

截图:

正常接收到参数…

 

原文:https://blog.csdn.net/li_xue_zhao/article/details/84553265

TAG标签: 微信小程序微信收不到信息

http://www.xiaochengxub.com/read-105450.html