Pergunta

I have a class

public class Client extends RestTemplate
// org.springframework.web.client.RestTemplate

What is RestTemplate used for?

Foi útil?

Solução

I assume you understand the concept of templating in spring. (its based on a design patten with the same name). RestTemplate is a template used to make HTTP Rest Calls (REST Client).

If you want to make a HTTP Call, you need to create a HttpClient, pass request and (or) form parameters, setup accept headers and perform unmarshalling of response, all by yourself, Spring Rest Templates, tries to take the pain away by abstracting all these details from you.

http://blog.springsource.com/2009/03/27/rest-in-spring-3-resttemplate/

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top