-
i found retryablehttp does not support followredirect option on setup,how can i realise follow redirect?thank you |
Beta Was this translation helpful? Give feedback.
Answered by
akkuman
Jul 19, 2022
Replies: 2 comments
-
var redirectFunc = func(_ *http.Request, _ []*http.Request) error {
// Tell the http client to not follow redirect
return http.ErrUseLastResponse
}
var retryablehttpOptions = retryablehttp.DefaultOptionsSpraying
client := retryablehttp.NewWithHTTPClient(&http.Client{
CheckRedirect: redirectFunc,
}, retryablehttpOptions) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ehsandeep
-
@Nyx2022 The snippet by @akkuman (thanks!) should show how to set the redirect policy. Let us know if you still need help. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Nyx2022