Please explain RestTemplate [closed]

隐身守侯 提交于 2019-12-05 00:22:27

问题


I have a class

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

What is RestTemplate used for?


回答1:


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/



来源:https://stackoverflow.com/questions/4721279/please-explain-resttemplate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!