Content-Length header 出现不止一次,最多允许一次

The Content-Length header occurred more than once, at most one is allowed

当我尝试通过以下 link 进行连接时:

http://192.168.4.1/wifisave?s=asdasd&p=10001010101010&ip=192.168.1.202&gw=192.168.1.1&sn=255.255.255.0&email=new@test.com&pass=123456789&alarm=1

我收到以下错误

The Content-Length header occurred more than once, at most one is allowed.

虽然正常link喜欢

http://192.168.1.200/anything

做作品,

甚至认为它以前可以工作,我不知道升级最新版本的库是否影响了它,尝试降级但由于 null-saftey 限制和其他 depandancies 我不能.. 代码行:

try {
String overAllLink='http://192.168.4.1/wifisave?s=asdasd&p=10001010101010&ip=192.168.1.202&gw=192.168.1.1&sn=255.255.255.0&email=new@test.com&pass=123456789&alarm=1';
    response = await http.get(Uri.parse(overAllLink));
  } catch (e) {
    print(e);
  }

编辑:当我尝试从 API 测试人员那里时,服务器响应是

> Host: 192.168.4.1
> User-Agent: insomnia/2021.2.2
> Content-Type: multipart/form-data; boundary=X-INSOMNIA-BOUNDARY
> Accept: */*
> Content-Length: 25

| --X-INSOMNIA-BOUNDARY--

* We are completely uploaded and fine
* Mark bundle as not supporting multiuse

< HTTP/1.1 200 OK
< Content-Type: text/html
< Content-Length: 1210
< Content-Length: 1210 //second one.
< Connection: close

所以服务器似乎发送了两次Content-Length,所以我怎么能忽略这个或解决它,我的服务器是安装了WiFiManger .16库的ESP8266。

好的,问题出在我的 ESP8266 服务器上,如问题中所述,它错误地发送了两次 Content-Length,打开一个问题 here 提到确实解决了问题,感谢库所有者。