0% found this document useful (0 votes)
910 views

REST With Spring Tutorial - Baeldung

This document provides an overview of building REST APIs with Spring. It begins with REST API basics like bootstrapping and configuration. It then covers more advanced topics such as HATEOAS, pagination, and testing. The guide organizes information on properly building REST APIs with Spring and ranges from fundamental concepts to specialized areas.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
910 views

REST With Spring Tutorial - Baeldung

This document provides an overview of building REST APIs with Spring. It begins with REST API basics like bootstrapping and configuration. It then covers more advanced topics such as HATEOAS, pagination, and testing. The guide organizes information on properly building REST APIs with Spring and ranges from fundamental concepts to specialized areas.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

10/3/2021 REST with Spring Tutorial | Baeldung

(/)

REST with Spring Tutorial


Last modi ed: January 16, 2021

by baeldung (https://www.baeldung.com/author/baeldung/)

REST (https://www.baeldung.com/category/rest/)
Series (https://www.baeldung.com/category/series/)
Spring (https://www.baeldung.com/category/spring/) +

Get started with Spring 5 and Spring Boot 2, through the


Learn Spring course:
>> LEARN SPRING (/ls-course-start)

Building a REST API is not a trivial task - from the high level RESTful
constraints down to the the nitty-gritty of making everything work and work
well.
Spring has made REST a rst class citizen and the platform has been maturing
in leaps and bounds. With the Spring 5 release, REST is now battle hardened
and fully mature.
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, the Spring
MVC Con guration, basic customization.
It then dives into the more advanced areas of REST - HATEOAS and
pagination, Error Handling and testing.
https://www.baeldung.com/rest-with-spring-series 1/6
10/3/2021
pag at o , o a dl g a d testRESTgwith Spring Tutorial | Baeldung

REST API Basics

Bootstrapping a Web Application (/bootstraping-a-web-application-


with-spring-and-java-based-con guration)
Building a REST API (/building-a-restful-web-service-with-spring-
and-java-based-con guration)
The Spring @Controller and @RestController Annotations (/spring-
controller-vs-restcontroller)
Error Handling for REST (/exception-handling-for-rest-with-spring)
(popular)
Entity To DTO Conversion for a Spring REST API (/entity-to-and-from-
dto-for-a-java-spring-application)
Spring’s RequestBody and ResponseBody Annotations (/spring-
request-response-body)
How to Read HTTP Headers in Spring REST Controllers (/spring-rest-
http-headers)
Using Spring @ResponseStatus to Set HTTP Status Code (/spring-
response-status)
Using Spring ResponseEntity to Manipulate the HTTP Response
(/spring-response-entity)

REST API Advanced Topics

Setting Up Swagger 2 with a Spring REST API  (/swagger-2-


documentation-for-spring-rest-api)
D ti S i
https://www.baeldung.com/rest-with-spring-series REST API U i O API (/ i t 2/6
10/3/2021 REST with Spring Tutorial | Baeldung
Documenting a Spring REST API Using OpenAPI 3.0 (/spring-rest-
openapi-documentation)
Request Method Not Supported (405) in Spring (/spring-request-
method-not-supported-405)
HATEOAS for a Spring REST Service (/rest-api-discoverability-with-
spring)
REST API Discoverability and HATEOAS (/restful-web-service-
discoverability)
Versioning a REST API (/rest-versioning)
REST Pagination (/rest-api-pagination-in-spring)
ETags for REST (/etags-for-rest-with-spring)
Spring MVC Content Negotiation (/spring-mvc-content-negotiation-
json-xml)
Spring REST API with Protocol Bu ers (/spring-rest-api-with-protocol-
bu ers)
A Custom Media Type for a Spring REST API (/spring-rest-custom-
media-type)
Handling URL Encoded Form Data in Spring REST (/spring-url-
encoded-form-data)
Generate Spring Boot REST Client with Swagger (/spring-boot-rest-
client-swagger-codegen)
Spring REST API + OAuth2 + Angular (/rest-api-spring-oauth2-angular)
(popular)

Test and Consume the API

Test a REST API with Java (/integration-testing-a-rest-api)


The Guide to RestTemplate (/rest-template)
https://www.baeldung.com/rest-with-spring-series 3/6
10/3/2021 REST with Spring Tutorial | Baeldung

RestTemplate Post Request with JSON (/spring-resttemplate-post-


json)
RestTemplate with Basic Authentication (/how-to-use-resttemplate-
with-basic-authentication-in-spring)
Get and Post Lists of Objects with RestTemplate (/spring-rest-
template-list)
Con gure a RestTemplate with RestTemplateBuilder (/spring-rest-
template-builder)
Spring RestTemplate Error Handling (/spring-rest-template-error-
handling)
Uploading MultipartFile with Spring RestTemplate (/spring-rest-
template-multipart-upload)
Spring WebClient vs. RestTemplate (/spring-webclient-resttemplate)
Spring WebClient Requests with Parameters (/web ux-webclient-
parameters)
Spring WebClient Filters (/spring-webclient- lters)
Spring WebClient and OAuth2 Support (/spring-webclient-oauth2)
Spring RestTemplate Request/Response Logging (/spring-
resttemplate-logging)
Reading an HTTP Response Body as a String in Java (/java-http-
response-body-as-string)

Other Spring Tutorials

Persistence with Spring Tutorial (/persistence-with-spring-series/)


Building the Persistence Layer of an application with Spring and
Hibernate, JPA, Spring Data, etc
Spring Exceptions Tutorial (/spring-exceptions)
https://www.baeldung.com/rest-with-spring-series 4/6
10/3/2021
Sp g cept o s uto al ( RESTsp withgSpring
e Tutorial
cept| Baeldung
o s)
Common Exceptions in Spring with examples – why they occur and how
to solve them quickly
Security with Spring (/security-spring)
How to Secure an MVC project, Login and Logout, how to Secure a REST
Service, Basic and Digest Authentication with Spring Security

Get started with Spring 5 and Spring Boot 2, through


the Learn Spring course:
>> THE COURSE (/ls-course-end)

2 COMMENTS   Oldest 

View Comments

Comments are closed on this article!

CATEGORIES
SPRING (HTTPS://WWW.BAELDUNG.COM/CATEGORY/SPRING/)
REST (HTTPS://WWW.BAELDUNG.COM/CATEGORY/REST/)

https://www.baeldung.com/rest-with-spring-series 5/6
10/3/2021 REST with Spring Tutorial | Baeldung

JAVA (HTTPS://WWW.BAELDUNG.COM/CATEGORY/JAVA/)
SECURITY (HTTPS://WWW.BAELDUNG.COM/CATEGORY/SECURITY-2/)
PERSISTENCE (HTTPS://WWW.BAELDUNG.COM/CATEGORY/PERSISTENCE/)
JACKSON (HTTPS://WWW.BAELDUNG.COM/CATEGORY/JSON/JACKSON/)
HTTP CLIENT-SIDE (HTTPS://WWW.BAELDUNG.COM/CATEGORY/HTTP/)

SERIES
JAVA “BACK TO BASICS” TUTORIAL (/JAVA-TUTORIAL)
JACKSON JSON TUTORIAL (/JACKSON)
HTTPCLIENT 4 TUTORIAL (/HTTPCLIENT-GUIDE)
REST WITH SPRING TUTORIAL (/REST-WITH-SPRING-SERIES)
SPRING PERSISTENCE TUTORIAL (/PERSISTENCE-WITH-SPRING-SERIES)
SECURITY WITH SPRING (/SECURITY-SPRING)

ABOUT
ABOUT BAELDUNG (/ABOUT)
THE COURSES (HTTPS://COURSES.BAELDUNG.COM)
JOBS (/TAG/ACTIVE-JOB/)
THE FULL ARCHIVE (/FULL_ARCHIVE)
WRITE FOR BAELDUNG (/CONTRIBUTION-GUIDELINES)
EDITORS (/EDITORS)
OUR PARTNERS (/PARTNERS)
ADVERTISE ON BAELDUNG (/ADVERTISE)

TERMS OF SERVICE (/TERMS-OF-SERVICE)


PRIVACY POLICY (/PRIVACY-POLICY)
COMPANY INFO (/BAELDUNG-COMPANY-INFO)
CONTACT (/CONTACT)

https://www.baeldung.com/rest-with-spring-series 6/6

You might also like