Documentation
¶
Overview ¶
Package client provides some customizable http client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRoundTripper ¶
func NewRoundTripper( keepaliveDuration time.Duration, connectTimeout time.Duration, responseHeaderTimeout time.Duration, idleConnectionTimeout time.Duration, maxIdleConnections int, serverName string, ) http.RoundTripper
NewRoundTripper returns a http.RoundTripper that has some tunable parameters.
Types ¶
type Client ¶
type Client interface {
http.RoundTripper
HttpClient() *http.Client
Do(req *http.Request) (*http.Response, error)
Get(url string) (resp *http.Response, err error)
Head(url string) (resp *http.Response, err error)
Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
PostForm(url string, data url.Values) (resp *http.Response, err error)
// contains filtered or unexported methods
}
Client is an http.Client with some tunable parameters.
func NewClient ¶
func NewClient( keepaliveDuration time.Duration, connectTimeout time.Duration, responseHeaderTimeout time.Duration, idleConnectionTimeout time.Duration, maxIdleConnections int, redirectSupport bool, serverName string, ) Client
NewClient returns a Client interface that has some tunable parameters.
Click to show internal directories.
Click to hide internal directories.