https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html
小程序的ajax请求 wx.request 的get请求支持通过body传json吗,如果支持的话,使用方式是什么样的?
框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|
小程序 | Bug | wx.request | 微信iOS客户端 | 7.0.0 | >2.9.2 |
https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html
小程序的ajax请求 wx.request 的get请求支持通过body传json吗,如果支持的话,使用方式是什么样的?
2 个回答
应该是不支持的,如果用body的话,只能改成POST了
body???
get请求,参数请放在 data中。。。
wx.request({ url: "某接口地址", method: "get", data: { "msg":{ "idCard": this.data.idCard, } }, header: { "Content-Type":"application/json;charset=UTF-8" }, success: function (res) { console.log(res.data); }, })