5 ms·
You can tell http.Client to not redirect: client := &http.Client{ CheckRedirect: func(req *http.Request, via []*http.Request) error { r
by fork-while-fork 5y 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.