微信小程序的wx:request请求,当method为post并向后台传输数据,但后台并未接收到数据。
如图

用httprequester模拟器发送post数据,发现可以接收到,表示服务端代码没有问题,只能是小程序代码出现问题,众所周知,微信小程序和后台交互是json传输数据,所以header需要声明json数据。

当数据传输方式为post时,后台接收不到数据,需要将header更改为:
header: { 'content-type': 'application/x-www-form-urlencoded' } 如图:

网友评论