天天看点

iOS9Http请求失败

在iOS9之后发送网络请求会报错误

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -)
           

解决办法

1.在Info.plist中增加NSAppTransportSecurity类型Dictionary。

2.在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

iOS9Http请求失败

参考文件:https://segmentfault.com/a/1190000002933776

继续阅读