【解决方案】Http请求报错

如题:

如果发起HTTP请求提示如下错误:

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


请修改配置信息:

1、在 Info.plist 中添加 NSAppTransportSecurity 类型设为 Dictionary 

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


实例如图:



posted @ 2016-01-11 19:45  Mr.Kay  阅读(374)  评论(0)    收藏  举报