Supported http content encodings: gzip, deflate, br (aka Brotli format)
package main
import (
"github.com/oripio/respreader""log""net/http"
)
funcmain() {
url:="https://google.com/"client:= http.Client{}
req, err:=http.NewRequest("GET", url, nil)
iferr!=nil {
log.Fatal(err)
}
resp, err:=client.Do(req)
iferr!=nil {
log.Fatal(err)
}
deferresp.Body.Close()
bresp, err:=respreader.Decode(resp)
iferr!=nil {
log.Fatal(err)
}
log.Print(string(bresp))
}Brotli and these bindings are open-sourced under the MIT License - see the LICENSE file.