Xcode7 使用NSURLSession发送HTTP请求的问题

network | | 访问(62)

错误代码: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.

Xcode7 使用NSURLSession发送HTTP请求的问题

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

解决方案:编辑 info.plist,加入如下设置:

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