Spring Boot REST API Development
23 lessons in this section of the Spring Boot tutorial. Work through them in order, or jump to the one you need.
- 1.Building REST APIs
A complete guide to building a production-ready REST API with Spring Boot 3: controller design, HTTP methods and status codes, request validation, DTOs, a consistent…
- 2.REST Principles
REST (Representational State Transfer) is an architectural style for distributed hypermedia systems, defined by Roy Fielding in 2000.
- 3.CRUD Operations
CRUD — Create, Read, Update, Delete — is the standard set of operations for managing persistent resources in a REST API.
- 4.Request Mapping
Request mapping is how Spring Boot routes incoming HTTP requests to controller handler methods.
- 5.Path Variables
Path variables extract dynamic segments from a URI directly into handler method parameters.
- 6.Request Parameters
Request parameters are the key-value pairs appended to a URL after the ?
- 7.Request Body
@RequestBody binds the HTTP request body to a method parameter, deserializing it from JSON (or XML) into a Java object using Spring's HttpMessageConverters.
- 8.ResponseEntity
Learn how to use ResponseEntity in Spring Boot to control the HTTP status code, headers and body: ok, created with Location, noContent, notFound, custom headers, file…
- 9.HTTP Status Codes
Spring Boot HTTP status codes explained: which code to return for GET, POST, PUT, DELETE, with ResponseEntity, @ResponseStatus, ProblemDetail and examples.
- 10.REST Controller
@RestController is the central annotation for building REST APIs in Spring Boot.
- 11.JSON Handling
Spring Boot uses Jackson as its default JSON library, auto-configured through spring-boot-starter-web.
- 12.XML Response
Spring Boot can serve XML responses alongside JSON using Jackson's XML extension (jackson-dataformat-xml).
- 13.Content Negotiation
How Spring Boot 3 picks the response format from the Accept header or a query parameter: JSON and XML setup, produces and consumes, 406 and 415 errors, a custom CSV…
- 14.File Upload API
Spring Boot handles file uploads through MultipartFile, auto-configured by MultipartAutoConfiguration.
- 15.File Download API
How to serve file downloads in Spring Boot with ResponseEntity<Resource>: attachment vs inline, streaming large files without running out of memory, S3 downloads, range…
- 16.Pagination
Spring Data provides first-class pagination support through the Pageable abstraction and Page<T> return type.
- 17.Sorting
Spring Data turns ?sort=name,asc into a Sort object automatically, either inside a Pageable or as a standalone parameter.
- 18.Filtering APIs
Filtering lets clients narrow a collection to only the records they need.
- 19.API Versioning
API versioning lets you evolve a REST API without breaking existing clients.
- 20.Validation in REST APIs
Spring Boot validation explained: @Valid vs @Validated, constraints, exception handling, custom validators, nested objects, groups and tests, with examples.
- 21.Exception Handling in APIs
Proper exception handling shapes how errors are communicated to API consumers.
- 22.Global Exception Handling
A controller advice turns exceptions into consistent HTTP error responses in one place instead of try/catch blocks in every controller.
- 23.Custom Exceptions
A well-designed custom exception hierarchy makes error handling explicit, consistent, and easy to extend.