Documentation ¶
Overview ¶
Package simplehttp is a very simple HTTP client helper library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Client = &http.Client{ Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).DialContext, ForceAttemptHTTP2: true, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, }, }
Client is the underlying HTTP client that will be used by Request.
View Source
var RateLimit = rate.NewLimiter(rate.Every(time.Second), 1) // 1 request per second.
RateLimit will be used by Request to ensure we do not overload the servers we use.
View Source
var UserAgent string
UserAgent is the user-agent string that should be provided with requests. If UserAgent is empty, Request will return an error.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.