We have already gone through the RestTemplate examples for accessing REST APIs inside spring application. In this example, we are extending the configuration to use Apache HttpClient 4. The purpose of this tutorial is to give you pre-cooked recipe for little head-start, and save you from writing all bits and pieces.
After learning to build Spring REST based RESTFul APIs for XML representation and JSON representation, let’s build a RESTFul client to consume APIs which we have written. Accessing a third-party REST service inside a Spring application revolves around the use of the Spring RestTemplate class. The RestTemplate class is designed on the same principles as […]
In Spring REST XML tutorial, we learned about building RESTFul APIs which were able to return XML representations of resources. In this tutorial, we will learn to write APIs capable of returning JSON representations of resources. 1) Using @ResponseBody Annotation This technique is simple and easy. You have to include only jackson dependencies into classpath […]
In this tutorial, I am writing hello world example for RESTful APIs using Spring REST features. In this example, I will be creating two APIs which will return XML representation of resources. Maven Dependencies Let’s start with runtime dependencies which you will need to write these RESTFul APIs. In fact, all you need is Spring […]