iOS9中HTTP协议的变化

问题

iOS9以后的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.

原因

由于iOS9中,苹果将原http协议改成了https协议,使用TLS1.2 SSL加密请求数据。
解决方案
在info.plist文件加入key

NSAppTransportSecurity
    
        NSAllowsArbitraryLoads
        
    

效果下图:

Paste_Image.png

你可能感兴趣的:(iOS9中HTTP协议的变化)