-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Arjen Poutsma opened SPR-5260 and commented
RestTemplate is going to be the central class for client-side REST access. It takes the familiar pattern of JdbcTemplate, JmsTemplate, etc., and applies it to REST.
The RestTemplate is going to integrate with the OXM abstraction, to be moved over, and will have other conversion mechanisms as well.
Here is some pseudo-code code to show how it might work:
String uri = "http://example.com/hotels/{id}"
template = new RestTemplate();
HotelList result = template.getForObject(uri, HotelList.class, "1");
Booking booking = // create booking object
uri = "http://example.com/hotels/{id}/bookings";
Map<String, String> vars = Collections.singletonMap("id", "1");
URI location = template.postForLocation(uri, booking, vars);
template.delete(location.toString());
template.execute(uri, HttpMethod.GET, myRequestCallback, myResponseCallback);
This issue is a sub-task of #9097
Issue Links:
- Migrate OXM from Spring-WS to Spring Core [SPR-5259] #9933 Migrate OXM from Spring-WS to Spring Core ("depends on")
2 votes, 3 watchers