默认情况下,Android Pie 将请求应用使用 HTTPS 连接而不是 HTTP。 因此无法在 HTTP 中访问 Restful API
最佳答案
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 连接。
关于http - Flutter : By default, Android Pie 将请求应用程序使用 HTTPS 无 HTTP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55002111/