GoBlog/httpClient.go

20 lines
276 B
Go
Raw Normal View History

2021-03-31 07:29:52 +00:00
package main
import (
"net/http"
"time"
)
type httpClient interface {
Do(req *http.Request) (*http.Response, error)
}
2021-06-19 06:37:16 +00:00
func getHTTPClient() httpClient {
return &http.Client{
Timeout: 5 * time.Minute,
Transport: &http.Transport{
DisableKeepAlives: true,
},
}
}