HTTP Bad chunk header 和 Illegal or missing hexadecimal sequence in chunked-encoding 解决方法
HTTP About 737 words错误信息
错误一
org.apache.http.MalformedChunkCodingException: Bad chunk header: {"a":["b"],"c":["d"]}错误二
curl: (56) Illegal or missing hexadecimal sequence in chunked-encoding原因
Connection: close必须放在Header中的最后一段。解析HTTP报文时,解析到Connection: close就不再继续解析之后的报文。
错误示例
< HTTP/1.1 400
< Connection: close
< Date: Thu, 13 Oct 2022 06:02:01 GMT
< Transfer-Encoding: chunked
< Content-Type: application/json
<
{ [21 bytes data]正确示例
< HTTP/1.1 400
< Date: Thu, 13 Oct 2022 06:02:15 GMT
< Transfer-Encoding: chunked
< Content-Type: application/json
< Connection: close
<
{ [27 bytes data]备注
400错误:默认Connection为close
401错误:默认onnection为keep-alive
参考
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection
                Views: 3,364 · Posted: 2023-03-14
            
            ————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
 
        Loading...