title: Obtaining list of redirect urls with Spring RestTemplate for HEAD/GET request
body: <p>As far as I'm aware I initialize the RestTemplate in the usual way:</p>
  <pre><code>val factory = HttpComponentsClientHttpRequestFactory() 
  factory.httpClient = HttpClientBuilder
          .create()
          .setRedirectStrategy(LaxRedirectStrategy())  // follow redirects
          .build()
  val restTemplate = RestTemplate(factory)
  val url = &quot;some url...&quot;
  val response = restTemplate.headForHeaders(url)
  </code></pre>
  <p>The automatic redirection works correctly but I want to obtain a list of all redirects that occurred along the way.
  I know that all redirects are being recorded inside the HttpContext object for each call but as far as I can tell there is no way to obtain the context itself from the RestTemplate.</p>
  <p>What's the best and correct way to to obtain all redirect urls from Springs RestTemplate?</p>