0

如何从 http.Response 获取状态文本?


import 'package:http/http.dart' as http;

void main() {
  final req = http.Request(method, Uri.parse('http://example.com'));
  final res = await http.Response.fromStream(await req.send());
  // HOW TO GET statusText???
}
4

1 回答 1

1

res.statusCode或者res.reasonPhrase

于 2020-09-18T10:43:42.397 回答