1、场景:
http请求用的是明码,如:“https://www.baidu.com”
2、bug描述
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.
2、原因:
Xcode7 不允许明文网络请求。
3、解决:
方法一:在info.plist中加入如下代码
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
方法二:在info.plist加如下字段