A lightweight HTTP client package for Golang
# Go Modules
require https://github.com/calvin-puram/httpclient/ghttp
// Import ghttp into your code.
import "github.com/calvin-puram/httpclient/ghttp"
// Configure the client
// First you need to configure and build the client as you need
reqHeaders := make(http.Header)
reqHeaders.Set("headers-key", "headers-value")
// setting global headers use:
SetHeaders(reqHeaders)
// setting user agent use:
SetUserAgent("user-agent")
// set max ideal connection per host use:
SetMaxIdleConns(5)
//specifies the amount of time to wait for a server's response headers after fully writing the request use:
SetResponseHeaderTimeout(5 * time.Second)
// default false: disable client request timeout use:
SetDisableTimeouts(false)
client := ghttp.NewBuilder().SetHeaders(reqHeaders).SetUserAgent("user-agent").
SetMaxIdleConns(5).SetResponseHeaderTimeout(5 * time.Second)SetDisableTimeouts(false).
Build() // build the client
Take a look at all of the examples folder for more information on how to make http calls