您的位置:首页 > 理论基础 > 计算机网络

IOS9起,网络协议新特性问题

2016-04-05 14:31 465 查看
使用Xcode7编写iOS9应用时,如果获取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.

原因:

从iOS9起,新特性要求App访问网络请求,要采用 HTTPS 协议。 

如果仍想要使用HTTP协议,解决办法如下:

1,在Info.plist中添加 NSAppTransportSecurity 类型 Dictionary ;

2,在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型Boolean ,值设为 YES;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: