App Transport Security has blocked a cleartext HTTP (http://)

使用SDWebImage加载“http://”开头的图片报错,错误如下:

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.

找查资料后发现,iOS新特性要求App内访问网络请求,要采用 HTTPS 协议。

解决办法如下:

在Info.plist文件中添加"App Transport Security Settings", Type设为"Dictionary",再添加"Allow Arbitray Loads", Type 设为"Boolean",“Value”为“YES”即可。

App Transport Security has blocked a cleartext HTTP (http://)

上一篇:【Python3之异常处理】


下一篇:接口请求失败处理,重新请求并限制请求次数.自己封装搞定retry函数