WeChat Mini Program - To configure the legal domain name request and the frequently encountered Douban api request 403 problem, you must first enter the homepage of the official website of the WeChat public platform, then click Settings in the lower right corner, and then look at the AppID and server in the development settings domain name for subsequent operations.
1. Configuring the legal domain name of the request
1 .Enter the homepage of the official WeChat public platform (mp.weixin.qq.com)
WeChat public platform|mini program homepage
2. Settings in the lower right corner
3. Development settings
There are AppID and server domain name
Always encounter Douban api request 403 problem
https://api.douban.com
( https://api.douban.com/v2/mov...
Unsuccessful use
The solution for netizens isReplace the original Douban api with the following URL
https: //douban.uieee.com and http://t.yushu.im/v2/movie/to...
For example, the interface of the top 250 Douban movies:
(https ://douban.uieee.com/v2/m...
(http://t.yushu.im/v2/movie/to... These domain names do not have security verification and are not https. Therefore, in the mini program It cannot be added to the legal domain name. So I only used the first https://douban.uieee.com.
The error is as shown in the figure:
Solution:
Modify the header in wx.request
//We need to modify the header in the request:
header:{
// "Content-Type":"application/json" //这里修改json为text ,因为原来json请求会返回400(bad request) **"Content-Type": "application/text"** },
#Rendering after successful solution:
WeChat Mini Program Development Practical Tutorial Development and Running WeChat Mini Program
How to develop WeChat Mini Program WeChat Mini Program development high-definition graphic tutorial
The above is the detailed content of Where can I find the legal domain name for configuration requests in the WeChat mini program?. For more information, please follow other related articles on the PHP Chinese website!