Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestTemplate [SPR-5260] #9934

Closed
spring-projects-issues opened this issue Oct 30, 2008 · 0 comments
Closed

RestTemplate [SPR-5260] #9934

spring-projects-issues opened this issue Oct 30, 2008 · 0 comments
Assignees
Labels
type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 30, 2008

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants