Skip to content

support redirect setting? #9

Closed
Closed

Description

@Nyx2022

i found retryablehttp does not support followredirect option on setup,how can i realise follow redirect?thank you

Activity

  1. akkuman commented on Jul 19, 2022

    @akkuman

    @Nyx2022

    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)
  2. Mzack9999 commented on Aug 3, 2022

    @Mzack9999
    Member

    @Nyx2022 The snippet by @akkuman (thanks!) should show how to set the redirect policy. Let us know if you still need help.

  3. locked and limited conversation to collaborators on Aug 3, 2022
  4. converted this issue into a discussion #23 on Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions