Skip to content

Latest commit

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

HTTP reader with automatic content decompression

Usage

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))
}

License

Brotli and these bindings are open-sourced under the MIT License - see the LICENSE file.

About

http reader with automatic content decompression

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages