Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Default global instance of a custom http.Client using the defaults from the options package Default = DefaultHTTPClient() // UserAgent can be used to specify the User-Agent header sent on every request that used this package's // http.Client UserAgent = "planb-tokeninfo" )
Functions ¶
func DefaultHTTPClient ¶
DefaultHTTPClient returns a new http.Client with KeepAlive disabled. That means no connection pooling. Use it only for one time requests where performance is not a concern It use some settings from the options package: options.HttpClientTimeout and options.HttpClientTlsTimeout
func Get ¶
Get issues a GET to the specified URL. It follows redirects, up to a maximum of 10
An error is returned if there were too many redirects or if there was an HTTP protocol error. A non-2xx response doesn't cause an error.
When err is nil, resp always contains a non-nil resp.Body. Caller should close resp.Body when done reading from it.
Get is a wrapper around Default.Get.
A User-Agent header is set for every request from the UserAgent variable in the same package
func NewHTTPClient ¶
NewHTTPClient returns a new http.Client with specific timeouts from its arguments. KeepAlive is disabled. That means no connection pooling. Use it only for one time requests where performance is not a concern
Types ¶
This section is empty.