
method 是 get 方式的时候,header为
{"Content-Type": 'application/json'},
method 为 post 时,header为
{"Content-Type": "application/x-www-form-urlencoded"}
wx:request
wx.request({url: '...www/runxiang_yiyao/Mobile/Index/login',method: 'post',data: util.json2Form({username: e.detail.value.username,password: e.detail.value.password,}),header: {"Content-Type": "application/x-www-form-urlencoded"},success: function (res) {console.log(util.formatTime)// console.log(res)}
})
参考:微信小程序wx.request 使用 post方式传参
本文发布于:2024-03-11 15:26:09,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/1710553354142175.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
| 留言与评论(共有 0 条评论) |