我正在使用HTTP包进行网络调用,我想知道这些调用的响应类型
发布于 2019-09-01 17:15:04
使用flutter_stetho dart包检查网络调用
访问斯泰索
将此包含到包的pubspec.yaml中
依赖关系:flutter_stetho:(版本) >>,例如flutter_stetho:^0.4.1
注意:仅基于dart版本的,选择Stetho包版本
发布于 2020-06-05 06:13:06
在“颤振17.1”版本中,他们给出了检查网络调用的很酷的特性,
通过点击open DevTools图标(在android的调试控制台中)打开开发工具,如下图所示

之后,它将在浏览器中安装这些工具并打开Dart dev tools,如下图所示

单击右上角烧瓶图标(在上面的图像中高亮显示),它将自动刷新页面,并在工具栏中显示网络选项,如下图所示

现在你可以检查你的每一个电话
发布于 2019-08-31 04:36:13
如果您只想知道reponse.body是什么,我不认为您需要一个单独的库来检查网络调用,因为您已经拥有了官方的Flutter团队强大的http库。
样本代码:
http.get("http://api.urbandictionary.com/v0/define?term=stackoverflow").then((response){
print("Status Code: ${response.statusCode}");//200 if successful
print("Response Body: ${response.body}");
// You can examine the response object either by referring the docs or using he suggestions you get in Android Studio / VS Code
})https://stackoverflow.com/questions/57735144
复制相似问题