This chapter focuses on building RESTful APIs using Spring Boot. You will learn how to create basic REST controllers, return JSON responses, handle path variables and query parameters, and implement CRUD operations for your application.
Overview
Syllabus
- Unit 1: Introduction to REST and Creating Your First REST Endpoint
- Create your First REST Controller
- Update REST Endpoint to Return JSON Object
- Add a New REST Endpoint
- Unit 2: Returning JSON Responses
- Returning JSON from Spring Boot
- Refactor Recipe Model to Use Java Records
- Customize JSON Serialization for Recipe POJO
- Unit 3: Handling Path Variables and Query Parameters
- Path Variables and Query Parameters
- Refactor to Use Optional in @RequestParam
- Fix Path Variable in Recipe Controller
- Endpoint for Fetching Recipe by Category and ID
- Handling Query Parameters in Spring Boot
- Unit 4: Creating CRUD Endpoints
- CRUD Endpoints in Spring Boot
- Setting Common URL Prefix in the RecipeController
- Fixing Bug in RecipeController's POST and PUT Methods
- Implement POST /recipes Endpoint
- Implement PUT /recipes/{id} Endpoint
- Implement DELETE /recipes/{id} Endpoint
- Unit 5: Returning Status Codes with ResponseEntity
- Exploring CRUD with ResponseEntity
- Add ResponseEntity to POST /recipes Endpoint
- Add ResponseEntity to PUT /recipes Endpoint
- Add ResponseEntity to DELETE /recipes Endpoint