错误日志:请求失败--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 文件配置

解决方法

错误日志:请求失败--Error Domain=NSURLErrorDomain Code=-1022
A6A36E26-0BB1-4E59-B03B-A34A384A09B5.png

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

  1. 再在后面 添加 Allow Arbitrary Loads = YES 即可

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