I'm trying to consume a rest web services with Spring Traverson and basic restTemplate but it's not working...
I consume a rest web service which return :
GET /books/1 ContentType: application/hal+json { "title": "Les Misérables" , "ISBN": "9780685113974", "_embedded": { "author": { "firstName": "Victor" , "lastName": "Hugo" , "born": "18020226", "died": "18850522" }, "meta": { "type": "classic" , "country": "FR" } } }
I want to have resource classes on Java side who looks like these :
class Book {
String title;
String isbn;
Author author;
Meta meta;
}
class Author {
String firstName;
String lastName;
Date born;
Date died;
}
class Meta {
String type;
String country;
}
How can I use RestTemplate or Traverson with Resource, Resources or ResourceSupport classes to match these java objects ?