Some HTTP client code handles this automatically but in Apex you have to do the work yourself.
Documentation about HTTP 302 explains:
The HTTP response status code 302 Found is a common way of performing
URL redirection.
An HTTP response with this status code will additionally provide a URL
in the location header field. The user agent (e.g. a web browser) is
invited by a response with this code to make a second, otherwise
identical, request to the new URL specified in the location field.
So when you get this status code you need to make a second request using the value you find in the location header of the first response e.g.:
HttpResponse res = new Http().send(req);
while (res.getStatusCode() == 302) {
req.setEndpoint(res.getHeader('Location'));
res = new Http().send(req);
}