I’m trying to use Spring WebClient but it looks like it’s not following redirect.
This is how I initialize the code:
WebClient webClient = WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(HttpClient.create()
.followRedirect(true)
.filter(logRequest())
.build();
I’m trying to login to another endpoint which returns 302; I thought the client would follow the redirect but instead I get a ClientResponse with statuscode of 302 and empty body.
Am I missing anything in the client configuration? The same request done with another Http Client such as OkHttp works correctly.