wx.request 的get请求支持通过body传json吗?
发布于 5 年前 作者 kangna 11513 次浏览 来自 官方Issues

https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html

小程序的ajax请求 wx.request 的get请求支持通过body传json吗,如果支持的话,使用方式是什么样的?

1 回复

body???

get请求,参数请放在 data中。。。

   wx.request({
     url"某接口地址",
     method"get",
     data: {
       "msg":{
         "idCard"this.data.idCard,
       }
     },
     header: {
       "Content-Type":"application/json;charset=UTF-8"
     },
     successfunction (res) {
       console.log(res.data);
       },
   })
回到顶部