gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 04:36:50 24 4
gpt4 key购买 nike

如何从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???
}

最佳答案

res.statusCoderes.reasonPhrase

关于dart - 如何从http.Response获取状态文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63954167/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com