I have a http response which is gzipped.
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
var buf bytes.Buffer
}
How can I ungzipped it and parse it into my struct?
I saw a question like this: Reading gzipped HTTP response in Go
but it output the response into a standard output. Also the example runs into error, the
reader, err = gzip.NewReader(response.Body)
returns err as "EOF". How can I debug this?