微信小程序https发起请求失败的解决方法
https://blog.csdn.net/yuhui123999/article/details/60572888
https://blog.csdn.net/yuhui123999/article/details/60572888
https://blog.csdn.net/yuhui123999/article/details/60572888
微信小程序中wx.request是
发起的是HTTPS 请求,其method有两种方法:get和post。
method为get时,header必须为:
header: {
\'content-type\': \'application/json\'
},
method为post时,header必须为:
header: {
\'content-type\': \'application/x-www-form-urlencoded\'
},
如果header错误会导致后台得不到数据而报NullPointerException错误
- 上一篇 »微信小程序获取手机号失败? | 邓士鹏
- 下一篇 »微信小程序 图片加载失败处理方法