Xcode7 使用NSURLSession發送HTTP請求的問題

錯誤描述html

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.ios

 

在iOS9 中,蘋果將原http協議改爲了https協議,使用 TLS1.2 SSL加密請求數據。app

解決方法:post

在info.plist 加入keyui

 

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


相關文章
相關標籤/搜索