### [微信小程序request请求后台接口php的介绍](https://www.prosaas.cn/article/17313) **Published:** 2018-06-27T02:26:59 **Author:** 5201314 **Excerpt:** 这篇文章主要介绍了微信小程序request请求后台接口php的实例详解的相关资料,希望通过本文能帮助到大家,需… 这篇文章主要介绍了微信小程序request请求后台接口php的实例详解的相关资料,希望通过本文能帮助到大家,需要的朋友可以参考下 **微信小程序request请求后台接口php的实例详解** 后台php接口:http://www.vueyun.com/good/info 没有处理数据,直接返回了,具体再根据返回格式处理 public function getGoodInfo(Request $request) { $goods\_datas = $this->Resource->get(); return response()->json(\['status' => 'success','code' => 200,'message' => '获取成功','data'=>$goods\_datas\]); } 小程序index.js文件中 onLoad onLoad: function () { console.log('onLoad') wx.request({ //上线接口地址要是https测试可以使用http接口方式 url: 'http://www.vueyun.com/good/info', data: {}, method: 'GET', header: { 'content-type': 'application/json' }, success: function (res) { that.setData({ goodslist: res.data.data }); console.log(res.data.data, 1111111); }, }) }, wxml文件, {{item.img\_title}} ¥ {{item.good\_price}} 以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP中文网! 相关推荐:  后台https域名绑定和免费的https证书申请的介绍 微信小程序 触控事件的介绍 微信小程序的GET请求的介绍 以上就是微信小程序request请求后台接口php的介绍的详细内容,更多请关注知企PROSAAS其它相关文章! **Categories:** 后端开发 ---