Get the whole response body when the response is chunked?

前端 未结 7 965
旧巷少年郎
旧巷少年郎 2020-12-08 06:32

I\'m making a HTTP request and listen for \"data\":

response.on(\"data\", function (data) { ... })

The problem is that the response is chun

相关标签:
7条回答
  • 2020-12-08 07:10

    How about HTTPS chunked response? I've been trying to read a response from an API that response over HTTPS with a header Transfer-Encoding: chunked. Each chunk is a Buffer but when I concat them all together and try converting to string with UTF-8 I get weird characters.

    0 讨论(0)
提交回复
热议问题