Get the App
SLTechnology News&Howtos  ›  Development  › 

How does the request in WeChat Mini Programs request the background interface php

Shulou Source: shulou.com Published: 2022-05-31 20:59:13 09月21日 Update

Today, the editor will share with you the relevant knowledge about how request requests background interface php in WeChat Mini Programs. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

Detailed explanation of an example of WeChat Mini Programs request requesting background interface php

If the data is not processed, it is returned directly, and then processed according to the return format.

Public function getGoodInfo (Request $request) {$goods_datas = $this- > Resource- > get (); return response ()-> json (['status' = >' success','code' = > 200 training messages'= > 'get success', 'data'= > $goods_datas]);}

OnLoad in Mini Program index.js file

OnLoad: function () {console.log ('onLoad') wx.request ({/ / online interface address if https test can use http interface 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 file

{{item.img_title}} ¥{{item.good_price}} above is all the content of the article "how to request the background interface php by item.good_price request in WeChat Mini Programs". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Interfaces programs knowledge articles background content files processing different big successful addresses most examples that is data methods more formats knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Apple Docker Shulou Technology Microsoft