支持设置流控实例
This commit is contained in:
@ -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) // 序列化方法
|
||||
|
Reference in New Issue
Block a user