Hacker News new | ask | show | jobs
by fork-while-fork 1831 days ago
You can tell http.Client to not redirect:

    client := &http.Client{
        CheckRedirect: func(req *http.Request, via []*http.Request) error {
            return http.ErrUseLastResponse
        },
    }
Then use the client as normal. You can also modify the function for very specific redirect behavior.