xhttp provides a custom http client based on net/http.
The package provides an http client with the following features:
- Customized timeouts
- Proper handling of response Body
- Method for file downloading
- Ability to send plain
net/http.Request
- Convenient methods to set up headers of a request
go get github.com/golocron/xhttp
Examples can be found here
go run examples/examples.go
2019/05/10 21:03:52 http request succeeded: method GET, body:
{
"args": {},
"headers": {
"Accept-Encoding": "gzip",
"Host": "httpbin.org",
"User-Agent": "Go-http-client/1.1"
},
"origin": "127.0.0.1",
"url": "https://httpbin.org/get"
}