Home  >  Article  >  WeChat Applet  >  How to configure network request timeout in WeChat applet?

How to configure network request timeout in WeChat applet?

coldplay.xixi
coldplay.xixiOriginal
2020-07-14 14:59:508054browse

How to configure the network request timeout for the WeChat applet: first create a new WeChat applet directory; then open the [app.json] file and add the request request timeout parameters; then add the uploadFile timeout file; and finally connectSocket connection The socket timeout is sufficient.

How to configure network request timeout in WeChat applet?

How to configure network request timeout for WeChat applet:

1. First, create a new WeChat applet directory. As shown in the picture below

How to configure network request timeout in WeChat applet?

2. Then open the app.json file, as shown in the picture below

How to configure network request timeout in WeChat applet?

3. Then Add the networkTimeout attribute, request is the parameter of the request timeout, as shown in the figure below

How to configure network request timeout in WeChat applet?

4. You can also add the downloadFile parameter to represent the download timeout, as shown in the figure below

How to configure network request timeout in WeChat applet?

5. Then uploadFile represents the timeout of uploading files, as shown in the figure below

How to configure network request timeout in WeChat applet?

6. The last one is connectSocket It is the timeout for connecting to the socket, as shown in the figure below

How to configure network request timeout in WeChat applet?

Related learning recommendations:WeChat applet development tutorial

The above is the detailed content of How to configure network request timeout in WeChat applet?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn