I find it hard to understand that we need RoundTripper for Go.
https://golang.org/pkg/net/http/#RoundTripper
Explains the default Transport in Go:
var DefaultTransport RoundTripper = &Transport{ Proxy: ProxyFromEnvironment, Dial: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).Dial, TLSHandshakeTimeout: 10 * time.Second, }
But what's the difference between RoundTripper and this:
transport := &http.Transport{ Proxy: http.ProxyFromEnvironment, TLSHandshakeTimeout: timeout, Dial: dialfunc, DisableKeepAlives: true, }
My question is: RoundTripper is different from regular Transport ?
user2671513
source share