use*_*680 6 post asynchronous http async-await flutter
我对 Flutter 有一个真正的问题..
我使用“http”库向我的 Express 服务器发出 HTTP 请求。当我尝试发送 HTTP POST 请求时,我的服务器确实收到了它,但我的 Flutter 代码只是停止执行。
print("here");
http.Response response = await http.post(url, body:data);
print("got response!"); // Never executes
Run Code Online (Sandbox Code Playgroud)
我在 Logcat 中没有看到任何错误,即使我使用假网址或关闭我的服务器,同样的结果总是会发生。执行只是停止,没有任何错误。
有谁知道为什么???
谢谢!!
| 归档时间: |
|
| 查看次数: |
2238 次 |
| 最近记录: |