Skip to content

RestTemplate [SPR-5260] #9934

@spring-projects-issues

Description

@spring-projects-issues

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:

2 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions