Restful Web Service Using Spring Boot
Explore how to expose RESTful web services with Spring Boot by creating controllers annotated with @RestController. Understand using HTTP method-specific annotations like @GetMapping to handle CRUD operations and adhere to REST principles for resource identity and representation.
Objective
In the section on database integration, we have exposed two additional business capabilities in the application
- Add a club
- Search for a club
However, to make that feature usable we need to expose the rest endpoint. In this lesson, we will learn how to expose the RESTweb service using the Spring Framework and key annotation provided by it to enable the RESTprinciple.
How to do it?
Add required dependency
As per the philosophy of spring boot we need to identify and add the required dependency.
By now, we already know that dependency has to be added because we have used it in our Billionaire’s Club and Elite Club application. Yes, it’s a starter web dependency.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifa ...