iOS iOS9下修改回HTTP模式进行网络请求

升级为iOS9后,默认请求类型为https,如何使用http进行请求会报错

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

方案一:让服务器修改为TLS1.2

方案二:在plist中设置使用http请求

第一步:在plist中添加NSAppTransportSecurity项,此项为NSDictionary

第二步:在NSAppTransportSecurity下添加

NSAllowsArbitraryLoads类型为Boolean,value为YES

转载于:https://www.cnblogs.com/pretty-guy/p/4816367.html

猜你喜欢

转载自blog.csdn.net/weixin_34112900/article/details/93438649
ios
今日推荐