【发布时间】:2021-01-29 06:26:57
【问题描述】:
我用一个简单的 url api 在我的颤振应用中发出一个 http 请求:
Future<http.Response> getUsers() async {
try {
return await http
.get('https://reqres.in/api/users')
.timeout(const Duration(seconds: 10))
.catchError((e) {
print("=> catchError getUsers $e");
return null;
});
} on SocketException catch (e) {
print("=> catch SocketException getUsers $e");
return null;
} catch (e) {
print("=> catch getUsers $e");
return null;
}
}
错误信息是:
err FormatException:方案不以字母字符开头(在字符 1 处) https://reqres.in/api/users ^
已经切换到flutter版本的不同频道,不知道解决方法,谢谢!
【问题讨论】:
标签: flutter http dart get flutter-channel