微信小程序的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) } })
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) } })
相关文章推荐
- 微信小程序的ajax数据请求wx.request
- 微信小程序wx.request请求用POST后台得不到传递数据
- 微信小程序wx.request请求服务器json数据并渲染到页面
- 微信小程序:wx.request之post请求后端无法获取数据的问题
- 微信小程序数据请求方法wx.request
- 微信小程序wx.request请求回来的数据没有及时显示到页面上
- 【微信小程序】request请求POST提交数据,记得要加上header
- 微信小程序- wx.request请求不到数据
- 微信小程序的ajax数据请求wx.request
- 微信小程序在开发工具上可以编译但是手机预览请求不到数据
- 微信小程序之request请求
- 微信小程序开发笔记之wx.request()的坑——将服务器返回的数据及时显示到视图层
- 微信小程序函数中有wx.request 返回值为undefined 因为request是异步请求
- 微信小程序ajax请求绑定数据简单实例
- 微信小程序-wx.request获取数据
- 微信小程序ajax实现请求服务器数据及模版遍历数据功能示例
- 微信小程序服务器请求和上传数据,上传图片并展示,提交表单完整实例代码附效果图
- 微信小程序request请求session失败
- 微信小程序网络请求wx.request请求
- 微信小程序 解决请求服务器手机预览请求不到数据的方法