Created
January 3, 2017 00:44
-
-
Save jecyhw/08ccad9c74e2b623f023f93e9c8f1678 to your computer and use it in GitHub Desktop.
followredirect in resttemplate when http status 302
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(); | |
HttpClient httpClient = HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()).build(); | |
factory.setHttpClient(httpClient); | |
RestTemplate restTemplate = new RestTemplate(); | |
restTemplate.setRequestFactory(factory); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment