Golang NewChunkedReader Usage

1.7k Views Asked by At

I'm attempting to process a chunked response from a 3rd-party service by introducing it to httputil.NewChunkedReader:

chunkedReader := httputil.NewChunkedReader(chunkedResponse)

buf := new(bytes.Buffer)
buf.ReadFrom(chunkedReader)
return buf.Bytes()

This code returns zero bytes, as does manually invoking reader.Read.

I'm looking for a practical example in terms of implementing httputil.NewChunkedReader.

0

There are 0 best solutions below