Spring RestTemplate follow redirect with cookie
Recently I ran into a problem where I needed to do a GET request to a remote service (Using a simple servlet i presume), and RestTemplate returned Too many redirects! . After some investigation, it seems like the first request made to the specified remote service, is actually just a 302-redirect (to itself) with some Set-Cookie headers. If I were using a "normal" browser, it would acknowledge the header, set the cookies correctly, and follow the redirect where it should meet a normal 200 response. What I've found is that RestTemplate doesn't accept the Set-Cookie header, so the redirect gets