更新时间:2021-06-30 19:14:04
coverpage
Title Page
Dedication
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
A Few Basics
REST – a basic understanding
Uniform interface
Client and server
Stateless
Cacheable
Layered system
Code on demand (COD)
More on REST
Imperative and Reactive programming
Reactive Streams
Benefits of Reactive programming
Reactive programming in Java and Spring 5
Our RESTful web service architecture
Summary
Building RESTful Web Services in Spring 5 with Maven
Apache Maven
Creating a project with Maven
Viewing a POM file after creating a project
POM file structure
Understanding POM dependencies
Adding Log4j 2.9.1 to POM dependency
Dependency trees
Spring Boot
Developing RESTful web services
Creating a project base
Working with your favorite IDE
Flux and Mono (Reactor Support) in Spring
Reactive Core and Streams
Back pressures and Reactive Streams
WebFlux
Basic REST API
Flux
Mono
User class with Reactive – REST
CRUD Operations in Spring REST
CRUD operations in Spring REST
HTTP methods
Reactive server initialization
Sample values in the repository
getAllUsers – mapping
getAllUsers – implementation in the handler and repository
Testing the endpoint – getAllUsers
getUser – implementation in the handler and repository
Testing the endpoint – getUser
createUser – implementation in the handler and repository
Testing the endpoint – createUser
updateUser – implementation in the handler and repository
Testing the endpoint – updateUser
deleteUser – implementation in the handler and repository
Testing the endpoint – deleteUser
CRUD Operations in Plain REST (Without Reactive) and File Upload
Mapping CRUD operations to HTTP methods
Creating resources
CRUD operation in Spring 5 (without Reactive)
getAllUsers – implementation
getUser – implementation
createUser – implementation
updateUser – implementation
deleteUser – implementation
File uploads – REST API
Testing the file upload
Spring Security and JWT (JSON Web Token)
Spring Security
Authentication and authorization
JSON Web Token (JWT)
JWT dependency
Creating a JWT token
Generating a token
Getting a subject from a JWT token
Getting a subject from a token
Testing RESTful Web Services
JUnit
MockMvc
Testing a single user