Xcode7發(fā)送HTTP請求失敗提示下面的信息:
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.
原因是因為安全問題拯田,ATS禁止了HTTP的明文傳輸∶逐校可以修改Info.plist文件,讓它臨時允許明文傳輸娃惯。
可以Source Code方式打開info.plist加上下面一段配置
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
也可以在屬性列表界面添加配置