错误日志:请求失败--Error Domain=NSURLErrorDomain Code=-1022 " The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."

错误信息:

请求失败--Error Domain=NSURLErrorDomain Code=-1022 "
The resource could not be loaded because the App 
Transport Security policy requires the use of a secure connection."

错误域
运输安全政策需要一个安全的链接使用

App Transport Security has blocked a cleartext HTTP (http://) 
resource load since it is insecure. Temporary exceptions can be 
configured via your app's Info.plist file.

应用程序安全运输了明文HTTP资源负载是不安全的。暂时的异常可以通过你的应用程序 info. plist 文件配置

解决方法

A6A36E26-0BB1-4E59-B03B-A34A384A09B5.png

如果所示:1.在info .plist 中添加 APP Transport Security Settings

  1. 再在后面 添加 Allow Arbitrary Loads = YES 即可
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容