Go requester is a package which is helping you to make HTTP requests easy than before.
https://godoc.org/github.com/vladiacob/go_requester
go get github.com/vladiacob/go_requester
include (
..
requester "github.com/vladiacob/go_requester"
..
)
requester := requester.New(http.DefaultClient)
requester.SerUserAgent("test")
requester.SetAuthentication("username", "password")
var clientJSONResponse ClientResponse
response, err := requester.Make("GET", "http://localhost", map[string]string{}, &clientJSONResponse)
var clientStringResponse string
response, err = requester.Make("GET", "http://localhost", map[string]string{}, &clientStringResponse)
type Response struct {
Status int
Body []byte
}