-
-
Save sriganesh/a5d21982788a542f7776a0e3b6e436e6 to your computer and use it in GitHub Desktop.
Getting List of Objects with RestTemplate in Spring
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
RestTemplate restTemplate = new RestTemplate(); | |
try { | |
ResponseEntity<List<Claim>> claimResponse = restTemplate.exchange( | |
uri, | |
HttpMethod.GET, | |
null, | |
new ParameterizedTypeReference<List<Claim>>() {}); | |
if(claimResponse != null && claimResponse.hasBody()){ | |
claims = claimResponse.getBody(); | |
} | |
} catch (RestClientException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment