1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 微信小程序wx.request POST获取不到数据解决办法

微信小程序wx.request POST获取不到数据解决办法

时间:2024-01-04 17:30:29

相关推荐

微信小程序wx.request POST获取不到数据解决办法

get

//发起请求

wx.request({url: '/home/index/curd', //仅为示例,并非真实的接口地址 method:'GET', data: {title: '123', content: '456' }, header: {'content-type': 'application/json' }, success: function (res) {console.log(res.data) } }) post //发起请求 wx.request({url: '/home/index/curd', //仅为示例,并非真实的接口地址 method:'POST', data: {title: '123', content: '456' }, header: {'content-type': 'application/x-www-form-urlencoded' }, success: function (res) {console.log(res.data) } }) 解决办法:修改headder里面的属性值。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。