微信小程序 -----调用本地接口

就在我想放弃的时候  发现了这个https://www.cnblogs.com/yanduanduan/p/8628974.html点击打开链接


1.点击详情,并勾选项目设置中最后一行。

 

2.用小程序请求本地的后台服务接口

复制代码
 1     wx.request({  
 2       url: 'http://localhost:8090/DemoProject/myTest.do',  
 3       data:{},  
 4       method:'POST',  
 5       header: {  
 6         'content-type': 'application/x-www-form-urlencoded'  
 7       },  
 8       success: function (res) {  
 9         console.log(res.data)  
10       }  
11     })  

但是 报405错误  https://blog.csdn.net/qq_33919114/article/details/52709045点击打开链接

method方法不对

猜你喜欢

转载自blog.csdn.net/lettyisme/article/details/80936824