http - 在 Dart 中发出 HTTP GET 请求时出现 TypeError
问题描述
使用 Darthttp
包,我以这种方式创建请求:
var response = await http.get('some valid URL', headers: { ... })
有时,这会引发异常:
_TypeError (type '(HttpException) => Null' is not a subtype of type '(dynamic) => dynamic')
整个请求块被 try...catch 子句包围,但由于某种原因,这个异常没有被捕获。问题是什么?
解决方案
推荐阅读
- javascript - 如何通过jQuery从多个表中搜索数据
- .net-core - dotnet 应用程序,指定使用 appsettings 的环境
- diff - 比较两个 tar.gz
- scala - 在一列中嵌套数据
- python - 将 Tkinter 条目存储到新变量中
- jhipster - 在 Jhipster 模块中生成实体
- html - 调整窗口大小而不是挤压它们时将元素推离屏幕
- javascript - ionViewDidEnter 上的 scrollToBottom - 离子
- css - 在忍者表单中选择后隐藏单选按钮并更改框轮廓颜色
- visual-studio - 如何将我的批准添加到静态类 AssignmentMapType