go http transport源码了解
如何用http发送请求
几行core code:
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
MaxIdleConnsPerHost: 100,
IdleConnTimeout: 90 * time.Second,
}
httpClient := &http.Client{Transport: transport}
request, err := http.NewRequest("POST", url, body)
response, err := httpClient.Do(request)
transport
https://duyanghao.github.io/http-transport/