📅  最后修改于: 2022-03-11 14:56:54.956000             🧑  作者: Mango
Future get(String url) async {
//Pass headers below
return http.post(url, headers: {"Authorization": "Some token"}).then(
(http.Response response) {
final int statusCode = response.statusCode;
LogUtils.d("====response ${response.body.toString()}");
if (statusCode < 200 || statusCode >= 400 || json == null) {
throw new ApiException(jsonDecode(response.body)["message"]);
}
return _decoder.convert(response.body);
});
}