Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded b
来源:互联网 发布:阿里云ftp端口号 编辑:程序博客网 时间:2024/05/22 23:52
Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded b.......网络请求报这样的错
情景:一直用6的测试机测试,突然换成5s,运行之后,总是网络请求失败,打印error得到这样一个错误
原因:iOS9引入了新特性App Transport Security (ATS)
。详情:App Transport Security (ATS)
新特性要求App内访问的网络必须使用HTTPS
协议。
但是项目使用的是HTTP
协议,使用私有加密方式保证数据安全。现在也不能马上改成HTTPS
协议传输。
最快解决方式:
在Info.plist中添加NSAppTransportSecurity
类型Dictionary
。
在NSAppTransportSecurity
下添加NSAllowsArbitraryLoads
类型Boolean
,值设为YES
如果想要彻底解决得把http 协议改为https
阅读全文
0 0
- Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded b
- iOS xcode 7网络请求错误failure Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded
- iOS xcode 7网络请求错误failure Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded
- Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be
- iOS知识---webView加载网址报错Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded beca
- 进行网络出现问题Error Domain=kCFErrorDomainCFNetwork Code=-1022 "The resource could not be loaded because th
- Error Domain=NSURLErrorDomain Code=-1022
- Error Domain=NSURLErrorDomain Code=-1022
- Error Domain=NSURLErrorDomain Code=-999
- Response failed, error buffer: The resource could not be loaded because the App Transport Security p
- 装XP时出错,file setupdd.sys could not be loaded the error code is 4
- error ==Error Domain=NSURLErrorDomain Code=-1009
- error: Error Domain=NSURLErrorDomain Code=-1002
- Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.”
- iOSerror : Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost."
- Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost.
- [iOS]Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.”
- 调试突然报 Error Domain=NSURLErrorDomain Code=-1003
- ThinkPhp5 模型查询结果转化成数组
- VUE2 前端实现 静态二级省市联动选择select
- mybatise+oracle添加数据时如果数据存在就更新,如果不存在就插入
- 537. Complex Number Multiplication
- DOS命令:跨网段访问设置route
- Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded b
- 事故分析
- 线性最小二乘
- 根据Url参数调用具体的方法
- UE4-利用UMG动画制作场景切换Loading进度条
- JQ 获取祖、父、兄、子节点方法
- iOS 开发系统自带摇一摇
- php 发送qq邮件
- Ubuntu系统下汉字显示为方框解决方法