I created a basic REST controller that makes requests using the reactive web client in Spring-boot 2 using netty.
@RestController @RequestMapping("/test") @Log4j2 public class TestController { private WebClient client; @PostConstruct public void setup() { client = WebClient.builder() .baseUrl("http://www.google.com/") .exchangeStrategies(ExchangeStrategies.withDefaults()) .build(); } @GetMapping public Mono<String> hello() throws URISyntaxException { return client.get().retrieve().bodyToMono(String.class); } }
When I get a 3XX response code, I want the web client to redirect using the location in the response and recursively call this URI until I get a 3XX response.
The actual result I get is 3XX answer.
source share