MCPcopy Create free account
hub / github.com/imroc/req / T

Function T

transport.go:155–168  ·  view source on GitHub ↗

T create a Transport.

()

Source from the content-addressed store, hash-verified

153
154// T create a Transport.
155func T() *Transport {
156 t := &Transport{
157 Options: transport.Options{
158 Proxy: http.ProxyFromEnvironment,
159 MaxIdleConns: 100,
160 IdleConnTimeout: 90 * time.Second,
161 TLSHandshakeTimeout: 10 * time.Second,
162 ExpectContinueTimeout: 1 * time.Second,
163 TLSClientConfig: &tls.Config{NextProtos: []string{"http/1.1", "h2"}},
164 },
165 }
166 t.t2 = &h2internal.Transport{Options: &t.Options}
167 return t
168}
169
170// HttpRoundTripFunc is a http.RoundTripper implementation, which is a simple function.
171type HttpRoundTripFunc func(req *http.Request) (resp *http.Response, err error)

Callers 2

NewTransportFunction · 0.85
CFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected