mirror of
https://github.com/nabbar/golib.git
synced 2025-10-06 08:16:52 +08:00
Package HTTPCli:
- add interface for http client implement the function Do
This commit is contained in:
@@ -51,6 +51,10 @@ const (
|
||||
|
||||
type FctHttpClient func() *http.Client
|
||||
|
||||
type HttpClient interface {
|
||||
Do(req *http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
func GetTransport(DisableKeepAlive, DisableCompression, ForceHTTP2 bool) *http.Transport {
|
||||
return &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
|
Reference in New Issue
Block a user