xcode提示App Transport Security ha
2016-02-23 本文已影响52人
洛丹伦的夏天
Xcode7发送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>
也可以在属性列表界面添加配置
添加配置