iOS 网络请求--- 配置info.plist文件

一、配置info.plist

  <key>NSAppTransportSecurity</key>
  <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
  </dict>

以上代码添加在info.plist文件倒数第三行处 (右击info.plist -> Open As ->Source Code),如下图:

 

 

 

如果使用AFNetworking出现以下错误

在AFURLResponseSerialization.m文件中添加 self.acceptableContentTypes = [NSSetsetWithObjects:@"application/json", @"text/html",@"text/json",@"text/javascript", nil];红色部分

posted @ 2016-08-16 20:36  低头捡到蛋  阅读(8081)  评论(0编辑  收藏  举报