Any RESTful API needs to answer requests coming from their client; these requests are handled in Spring by a controller object. In this section, we will understand what a controller actually is and how the RestController will help us to create our first component in a RESTful API.
Understanding RestController
What is a controller
Each request coming to a RESTful API is a stateless message that mainly will:
- Ask for a resource
- Update a resource
- Create a resource
- Delete a resource
Those requests will use JSON as the mechanism to interchange information.
JavaScript Object Notation (JSON) is a human-readable data format to transmit objects. It is a language-independent data format, but it was derived from JavaScript. Most programming...