Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up the communication domain name by WeChat Mini Programs

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

The knowledge points of this article "how to set up a communication domain name by WeChat Mini Programs" are not quite understood by most people, so the editor summarizes the following contents to you. The content is detailed, the steps are clear, and it has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to set up a communication domain name by WeChat Mini Programs" article.

Each WeChat Mini Programs needs to set up a communication domain name in advance, and Mini Program can communicate with the specified domain name on the network. It includes normal HTTPS request (wx.request), WebSocket communication (wx.connectSocket), upload file (wx.uploadFile) and download file (wx.downloadFile).

Network API list:

API description wx.request initiates network request wx.uploadFile uploads file wx.downloadFile downloads file wx.connectSocket creates WebSocket connection wx.onSocketOpen listens WebSocket turns on wx.onSocketError snooping WebSocket error wx.sendSocketMessage sends WebSocket message wx.onSocketMessage accepts WebSocket message wx.closeSocket closes WebSocket connection wx.onSocketClose listens WebSocket closes Tip

Tip: the referer of a network request cannot be set, and the format is fixed as https://servicewechat.com/{appid}/{version}/page-frame.html, where {appid} is the appid of Mini Program, {version} is the version number of Mini Program, and a version number of 0 indicates the development version.

Tip: after Mini Program runs in the background (off-the-top chat), if the network request does not end within 5 seconds, the error message "fail interrupted" will be called back. Before returning to the foreground, the network request API call will fail.

The above is the content of this article on "how to set up the communication domain name of WeChat Mini Programs". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report