Obtaining list of redirect urls with Spring RestTemplate for HEAD/GET request
As far as I'm aware I initialize the RestTemplate in the usual way:
val factory = HttpComponentsClientHttpRequestFactory()
factory.httpClient = HttpClientBuilder
.create()
.setRedirectStrategy(LaxRedirectStrategy()) // follow redirects
.build()
val restTemplate = RestTemplate(factory)
val url = "some url..."
val response = restTemplate.headForHeaders(url)
The automatic redirection works correctly but I want to obtain a list of all redirects that occurred along the...