Flutter:默认情况下,Android Pie会请求应用使用HTTPS而不是HTTP请求

问题描述 投票:2回答:1

默认情况下,Android Pie会请求应用程序使用HTTPS连接而不是HTTP。因此无法在HTTP中访问restful API

http networking https flutter android-9.0-pie
1个回答
1
投票

https://android-developers.googleblog.com/2018/04/protecting-users-with-tls-by-default-in.html?m=1解释了如何选择退出特定域或任意域

<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">insecure.example.com</domain>
        <domain includeSubdomains="true">insecure.cdn.example.com</domain>
    </domain-config>
</network-security-config>

我不确定Android Pie中引入的限制和此处提到的选择退出适用于使用dart:io进行的HTTP连接。

© www.soinside.com 2019 - 2024. All rights reserved.