The RestTemplate is the main class meant for the client-side access for Spring-based RESTful services. The communication to the server is accomplished using the REST constraints. This is similar to other template classes such as JdbcTemplate, HibernateTemplate, etc provided by Spring. The RestTemplate provides high-level implementation details for the HTTP Methods like GET, POST, PUT, etc, and gives the methods to communicate using the URI template, URI path params, request/response types, request object, etc as part of arguments.
- Commonly used annotations like
@PutMapping, etc are provided by this class from Spring 4.3. Prior to that, Spring provided (and still provides)
@RequestMappingannotation to indicate what methods were being used.