gpt4 book ai didi

http - 加载数据时客户端异常

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

当我尝试从本地服务器请求数据时,发生以下错误:
ClientException (Connection closed before full header was received)
码:

void authanticate() async {
String authString =
'http' + '://' + ip + ':' + port + '/' + rec + '?password=' + pass;
print(authString);

var response = await get(authString);
print(response.statusCode);

print(response.body);
}
有没有办法解决此错误?

最佳答案

这应该用作http.get(authString)

void authanticate() async {
String authString =
'https' + '://' + ip + ':' + port + '/' + rec + '?password=' + pass;
print(authString);

var response = await http.get(authString);
print(response.statusCode);

print(response.body);
}

关于http - 加载数据时客户端异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63646310/

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