We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
类似创建一个client,设置全局的header和一些callback函数,以后每次请求就不用重复创建client了。
client = gout.New() client. Debug(true). SetTimeout(time.Duration(cc.timeout) * time.Second). SetHeader(gout.H{ "Content-Type": "application/json;v=1.0", "Accept": "application/json", "Authorization": fmt.Sprintf("Bearer %s", cc.token), }).F(). Retry().Attempt(3).WaitTime(time.Millisecond * 3).MaxWaitTime(time.Millisecond * 10). Func(func(c *gout.Context) error { if c.Error != nil { return filter.ErrRetry } // token过期,重新获取token后重试 if c.Code == 401 { cc.Login() return filter.ErrRetry } return nil })
The text was updated successfully, but these errors were encountered:
这个我考虑了下
Sorry, something went wrong.
No branches or pull requests
类似创建一个client,设置全局的header和一些callback函数,以后每次请求就不用重复创建client了。
The text was updated successfully, but these errors were encountered: