pcgamedb/utils/request.go

19 lines
380 B
Go
Raw Permalink Normal View History

2024-12-02 03:17:01 -05:00
package utils
import (
"time"
"github.com/go-resty/resty/v2"
)
var client *resty.Client
func init() {
client = resty.New()
client.SetRetryCount(3).SetRetryWaitTime(1 * time.Second)
}
func Request() *resty.Request {
2024-12-10 08:37:16 -05:00
return client.R().SetHeader("Accept-Charset", "utf-8").SetHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0")
2024-12-02 03:17:01 -05:00
}