Xcode中发送请求时,报如下错误
- 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内访问网络请求,要采用 HTTPS 协议,使用私有加密方式保证数据安全。
解决方案
- 在Info.plist中添加 App Transport Security Settings 类型 Dictionary
- 在 App Transport Security Settings 下添加 Allow Arbitrary Loads 类型Boolean ,值设为 YES