美文网首页
NSURLSession 发送请求时出现的配置错误

NSURLSession 发送请求时出现的配置错误

作者: OneCoinMan | 来源:发表于2016-10-16 23:07 被阅读0次

发送网络请求错误

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

解决方法

根据错误提示,需要配置info.plist文件:


或者以sourceCode形式打开info.plist文件,在其中加入如下代码:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowArbitrary</key>
<true/>
</dict>

相关文章

网友评论

      本文标题:NSURLSession 发送请求时出现的配置错误

      本文链接:https://www.haomeiwen.com/subject/nvjayttx.html