This commit is contained in:
assimon
2022-03-29 20:25:05 +08:00
commit 0b5eef242c
69 changed files with 3932 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package http_client
import (
"github.com/go-resty/resty/v2"
"time"
)
// GetHttpClient 获取请求客户端
func GetHttpClient(proxys ...string) *resty.Client {
client := resty.New()
// 如果有代理
if len(proxys) > 0 {
proxy := proxys[0]
client.SetProxy(proxy)
}
client.SetTimeout(time.Second * 5)
return client
}