Announcement Announcement Module
Collapse
No announcement yet.
How to get a List<MyObject> via RestTemplate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get a List<MyObject> via RestTemplate

    So if you just have one object you can do:
    Code:
    Mine m = restTemplate(getForObject(url, Mine.class);
    What about if the object coming across the wire is a List<Mine.class> how would you write that?

  • #2
    Hi, we are working on merging in changes from Spring 3.2, which will include generics support in RestTemplate requests. For now, this can be accomplished using arrays.

    Code:
    ResponseEntity<Mine[]> responseEntity = restTemplate.getForEntity(url, Mine[].class);

    Comment

    Working...
    X