21zoo Labs - Assorted Stuff

Golang HTTP Client - How to not follow redirects

Posted at — Oct 11, 2018
client: &http.Client{
    CheckRedirect: func(req *http.Request, via []*http.Request) error {
        return http.ErrUseLastResponse
    },
}

resp, err := client.Do(req) ...