售 价:¥
6.2
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐

Building a RESTful Web Service with Spring
Table of Contents
Building a RESTful Web Service with Spring
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. A Few Basics
REST principles
Uniform interface
Client-Server
Stateless
Cacheable
Layered system
Code on demand
The Spring Framework and REST
Our RESTful web service
Architecture
Data model
Summary
2. Building RESTful Web Services with Maven and Gradle
Apache Maven
Dependency management in Apache Maven
Gradle
Dependency management in Gradle
The structure of our sample web service
The anatomy of a Service Module
Local versus Remote Service Invocations
Developing RESTful web services
Working with your favorite IDE
Making services executable
Starting services with Maven
Summary
3. The First Endpoint
The Inventory service
REST and the MVC pattern
Request mapping
Path mapping
HTTP method mapping
Request parameter mapping
Running the service
A few words on data representation
Summary
4. Data Representation
The Data-Transfer-Object design pattern
The API response format
The envelope format
Error management
Pagination support
Customizing JSON responses
API evolutions
HATEOAS
Versioning strategies
URI versioning
Representation versioning
Other approaches
Summary
5. CRUD Operations in REST
Mapping CRUD operations to HTTP methods
Creating resources
Quickly testing endpoints
JSON versus form data
Updating resources
The update endpoint
Testing update requests
Deleting resources
Overriding the HTTP method
Summary
6. Performance
HTTP compression
Content negotiation
gzip or deflate?
gzip compression in RESTful web services
Spring Boot
HTTP caching
Cache-Control
Private/Public caching
No caching
ETags
Last-Modified/If-Modified-Since headers
Room availability
An overview of implementation
The REST resource
Adding HTTP caching
Caching with ETags
Summary
7. Dealing with Security
The booking service
The REST resource
Authentication
HTTP Basic authentication
Using Basic authentication with Spring
HTTP Digest authentication
Token-based authentication
Other authentication methods
Authorization
Authorization with Spring
URL mapping
Resource annotations
Input validation
Java Bean annotations
Regular expressions
Validating bookings
Encryption
Storing sensitive data
Summary
8. Testing RESTful Web Services
Unit testing Spring controllers
Mocking
Simple mocking
Implementation stubbing with a mocking library
Mockito and Spring
Testing security
Integration testing
Continuous delivery
Integration tests with Spring Boot
Postman
Postman and security
Other forms of testing
User Acceptance Testing
Load testing
Summary
9. Building a REST Client
The basic setup
Declaring a client
Remote versus local clients
Availability and booking services
Handling security
The Basic authentication
The Digest authentication
HTTP public key pinning
Exception handling
Summary
10. Scaling a RESTful Web Service
Clustering
Scaling up versus scaling out
The benefits of clustered systems
Load balancing
Linear scalability
Distributed caching
Data-tier caching
First-level caching
Second-level caching
Application-tier caching
Asynchronous communication
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜