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 可以臨時例外(就是可以通過)
Flutter Ios支持http請求數據配置方法:
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;