You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter安卓真机调用本地WAMP API报错求助

Flutter真机调用本地WAMP API报错问题

我正在用Flutter开发一款安卓移动应用,使用真机进行测试。本地WAMP服务器部署的API,在Insomnia中输入路由能正常返回JSON,但在Flutter应用中调用该路由却报错。

报错截图:
Flutter error

调用代码:

final httpResponse = await http.get(Uri.parse('$_baseUrl/motorlocations'));

已尝试过以下地址:

  • http://127.0.0.1:80/...
  • http://localhost:80/...
  • http://10.0.2.2:80/...
  • http://我的IPv4地址:80/...

从截图可见,错误显示的端口为42794,但我输入的是80端口。

我还尝试过执行命令:adb -d reverse tcp:42794 tcp:80,但并未生效。

内容的提问来源于stack exchange,提问作者MelW

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 02:33:15