Xcode使用HTTP配置

Xcode7 出现获取网络请求时出现如下异常:


 

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.

意思就是: App Transport Security (应用程序传输安全)阻止了一个明文HTTP传输,因为它是不安全的,配置你的Info.plist 可以临时例外(就是可以通过)


 

1、在Info.plist中添加  NSAppTransportSecurity, 按回车自动改变成App Transport Security Settings 类型 Dictionary ;
2、在 NSAppTransportSecurity 下添加  NSAllowsArbitraryLoads 按回车自动改变成Allow Arbitrary Loads 类型Boolean ,值设为 YES;
等价于
1 在Info.plist中直接添加 App Transport Security Settings, 类型 Dictionary 
2 在 NSAppTransportSecurity下直接添加 Allow Arbitrary Loads, 类型Boolean ,值设为 YES;


 

你可能感兴趣的:(Xcode使用HTTP配置)