Let's get started with a Microservice Architecture with Spring Cloud:
REST with Spring Series
Last updated: November 24, 2011
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
-
Building a REST API
-
Using Spring ResponseEntity to Manipulate the HTTP Response (popular)
-
How to Read HTTP Headers in Spring REST Controllers (popular)
-
Entity To DTO Conversion for a Spring REST API (popular)
-
Error Handling for REST (popular)
-
HTTP PUT vs. POST in REST API
-
Custom Error Message Handling for REST API (popular)
REST API Annotations
-
Spring @Controller and @RestController Annotations (popular)
-
Spring @RequestBody and @ResponseBody Annotations (popular)
-
Spring @PathVariable Annotation (popular)
-
Spring @RequestParam Annotation (popular)
-
Spring @RequestMapping (popular)
-
Spring @ResponseStatus Annotation
REST API Documenting and Versioning
-
Setting Up Swagger 2 with a Spring REST API (popular)
-
Documenting a Spring REST API Using OpenAPI 3.0 (popular)
-
Swagger @Parameter vs @Schema
-
Generate Spring Boot REST Client with Swagger (popular)
-
Versioning a REST API
-
@Operation vs @ApiResponse in Swagger
-
Setting Example and Description with Swagger (popular)
REST API Advanced Topics
-
REST Pagination (popular)
-
Handling URL Encoded Form Data in Spring REST
-
Setting a Request Timeout for a Spring REST API (popular)
-
Best Practices for REST API Error Handling (popular)
-
Get All Endpoints in Spring Boot
-
How to Make Multiple REST Calls in CompletableFuture
-
Avoid Brittle Tests for the Service Layer
REST API Testing
RestTemplate
-
The Guide to RestTemplate (popular)
-
A Guide to RestClient in Spring Boot (popular)
-
RestTemplate Post Request with JSON (popular)
-
Get and Post Lists of Objects with RestTemplate
-
Spring RestTemplate Error Handling (popular)
-
Uploading MultipartFile with Spring RestTemplate
-
RestTemplate with Basic Authentication
-
Configure a RestTemplate with RestTemplateBuilder (popular)
-
Spring RestTemplate Request/Response Logging (popular)
-
Access HTTPS REST Service Using Spring RestTemplate (popular)
WebClient
Other Spring Tutorials
-
Spring Boot Tutorial (popular) (Series) Get started with Spring Boot and learn how to customize a Spring Boot application
-
Spring Persistence Tutorial (popular) (Series) Learn how to work with Spring Data JPA and other Spring persistence technologies
-
Spring Security OAuth2 Guides (popular) (Series) Learn how to secure a REST API using Spring OAuth2 support
















