支持设置流控实例

This commit is contained in:
2025-04-14 18:45:24 +08:00
parent 06587ace43
commit 2d08e9a629
2 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,10 @@ func NewRestyClient(reqConfig *define.Request) (*resty.Client, *resty.Request) {
if nil == reqConfig {
return client, request
}
if nil != reqConfig.RateLimiter {
// 设置流控实例
client.SetRateLimiter(reqConfig.RateLimiter)
}
formatHeader(reqConfig)
client.SetAllowGetMethodPayload(true) // 配置 GET 请求允许带 Body
client.SetJSONMarshaler(json.Marshal) // 序列化方法