How to point to localhost:8000 with the Dart http package in Flutter?

前端 未结 9 1062
野趣味
野趣味 2020-12-10 00:34

I\'m following the Flutter Networking/HTTP tutorial to do a GET request to a server running on my localhost:8000. Visiting my localhost via my browser works fine. My code lo

9条回答
  •  有刺的猬
    2020-12-10 01:15

    Localhost via the computer browser I assume?

    Using "http://localhost:port" in the Flutter code points to the local emulator device and not the local server running on your coomputer.

    Point url to the IP Address of your server machine instead, that should solve the issue.

提交回复
热议问题