App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

网络请求时Xcode提示:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

在iOS9 beta1中,苹果将原http协议改成了https协议,使用 TLS1.2 SSL加密请求数据。

解决办法:

在info.plist中添加
<key>NSAppTransportSecurity</key><dict>
<key>NSAllowsArbitraryLoads</key>
<true/></dict>

原文链接:,转发请注明来源!

发表评论