May 2015
Intermediate to advanced
234 pages
4h 18m
English
REST uses a web service architecture; here, a client sends an HTTP request to a server, which sends back an HTTP response. JSON is most of the time used for data transfer. The list of URLs supported by the server is called the REST API. These URLs are kept simple using different HTTP methods. For example, the /users/3 request using the GET method will return the user whose ID is 3. The /users/3 request using the DELETE method will delete that same user.
In this recipe, we will create a simple REST service that will allow a REST client to query and modify a list of User objects on the server.
We will use the User class:
public class User { private Long id; private String name; private int age; public User() { } ...Read now
Unlock full access