Let's get started with a Microservice Architecture with Spring Cloud:
REST with Spring Series
Last updated: September 2, 2025
Building a REST API is not a trivial task – from the high-level RESTful constraints down to the nitty-gritty of making everything work and work well.
Spring has made REST a first-class citizen and the platform has been maturing in leaps and bounds.
With this guide, my aim is to organize the mountains of information that are available on the subject and guide you through properly building an API.
The guide starts with the basics – bootstrapping the REST API, basic usage, and annotations.
It then dives into the more advanced areas of REST – such as error handling, pagination, testing, and documenting the API.
Last but not least, it explores how to use different Spring REST clients, including RestClient, RestTemplate, and WebClient.
.
.
.
.
.
Prerequisites
.
.
.
.
.
REST API Basics
- Build a REST API with Spring and Java Config
- Using Spring ResponseEntity to Manipulate the HTTP Response
- How to Read HTTP Headers in Spring REST Controllers
- Entity To DTO Conversion for a Spring REST API
- Error Handling for REST with Spring
- HTTP PUT vs. POST in REST API
- Custom Error Message Handling for REST API
.
.
.
.
.
REST API Annotations
- The Spring @Controller and @RestController Annotations
- Spring’s RequestBody and ResponseBody Annotations
- Spring @PathVariable Annotation
- Spring @RequestParam Annotation
- Spring RequestMapping
- Using Spring @ResponseStatus to Set HTTP Status Code
.
.
.
.
.
REST API Documenting and Versioning
- Setting Up Swagger 2 with a Spring REST API Using Springfox
- Documenting a Spring REST API Using OpenAPI 3.0
- Swagger @Parameter vs @Schema
- Generate Spring Boot REST Client with Swagger
- Versioning a REST API
- @Operation vs @ApiResponse in Swagger
- Setting Example and Description with Swagger
.
.
.
.
.
REST API Advanced Topics
- REST Pagination in Spring
- Handling URL Encoded Form Data in Spring REST
- Setting a Request Timeout for a Spring REST API
- Best Practices for REST API Error Handling
- Get All Endpoints in Spring Boot
- How to Make Multiple REST Calls in CompletableFuture
- Avoid Brittle Tests for the Service Layer
.
.
.
.
.
REST API Testing
- Test a REST API with Java
- Testing Exceptions with Spring MockMvc
- REST API Testing with Cucumber
- Introduction to WireMock
- A Guide to REST-assured
- Getting and Verifying Response Data with REST-assured
- Test a REST API with curl
.
.
.
.
.
RestTemplate
- The Guide to RestTemplate
- A Guide to RestClient in Spring Boot
- RestTemplate Post Request with JSON
- Get and Post Lists of Objects with RestTemplate
- Spring RestTemplate Error Handling
- Uploading MultipartFile with Spring RestTemplate
- Basic Authentication with the RestTemplate
- Configure a RestTemplate with RestTemplateBuilder
- Spring RestTemplate Request/Response Logging
- Access HTTPS REST Service Using Spring RestTemplate
.
.
.
.
.
WebClient
- Spring WebClient
- Spring WebClient Requests with Parameters
- Spring WebClient Filters
- Get List of JSON Objects with WebClient
- Spring WebClient and OAuth2 Support
- Simultaneous Spring WebClient Calls
- Spring WebClient vs. RestTemplate
.
.
.
.
.
Other Spring Tutorials
.
.
.
.
.

















