A fast and simple go http client
go get -u github.com/voocel/httpgo
res, err := httpgo.Get("http://www.google.com").Do()
res, err := httpgo.Post("http://www.google.com").Do()
res, err := httpgo.Get("http://www.google.com").SetTimeout(5 * time.Second).Do()
var l *log.logger
c := httpgo.NewHttpClient(WithLogger(l))
res, err := c.Get("http://www.google.com").Do()
res, err := c.Post("http://www.google.com").Do()
- SetQuery(
key, value string
) - SetQueries(
m map[string]string
) - SetForm(
m map[string]string
) - SetJSON(
v string
) - SetText(
v string
) - SetFile(
fieldname, filename string
) - SetTimeout(
t time.Duration
) - SetHeader(
key, value string
) - SetHeaders(
m map[string]string
) - AddHeader(
key, value string
) - AddHeaders(
m map[string]string
) - SetUA(
ua string
) - AddCookie(
c *http.Cookie
) - BasicAuth(
username, password string
) - Upload(
fieldname, filename string
)