小程序post请求获取不到数据问题
把headers的参数“Content-Type”的值改为application/x-www-form-urlencoded;
Request Body Type 的值应为URLEncoded from data ;这项不改也post不到值;
在js中这样写
wx.request({ url: host + "/card/create", header: { "Content-Type": "application/x-www-form-urlencoded" }, method:"POST", data:{ 'card_no':e.detail.value['card_no'] }, success:function(result){ wx.showToast({ title: '请求成功!', icon: 'success', mask: true, duration: 2000 }) }