您的位置:首页 > 产品设计 > UI/UE

微信小程序的request数据请求

2018-03-24 14:36 363 查看
微信小程序request请求
get方法:

wx.request({ url: http_host+'/home/good/'+id+'/edit', method: 'GET', header: { "Content-Type": "application/x-www-form-urlencoded" }, success: function (res) { console.log('banner',res.data); that.setData({ good_message:res.data.good, product_detail:res.data.detali, product_list: res.data, pro_msg: res.data.detali, pro_pos:res.data.guige }) } })
post方法:

wx.request({ url: http_host + '/home/share', method: 'post', header: { "Content-Type": "application/x-www-form-urlencoded" }, data: { 要post的数据 }, success: function (res) { console.log('提交成功', res) } })
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  小程序request