rest template how to get list of objects code example
Example 1: resttemplate post return list of objects
ResponseEntity<List<MyObj>> res = restTemplate.postForEntity(getUrl(), myDTO, new ParameterizedTypeReference<List<MyObj>>() {});
Example 2: resttemplate response object list
ResponseEntity<List<MyObj>> res = restTemplate.exchange(getUrl(), HttpMethod.POST, myDTO, new ParameterizedTypeReference<List<MyObj>>() {});