pcgamedb/utils/request.go

19 lines
343 B
Go

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 {
return client.R().SetHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0")
}