Book description
The popularity of REST in recent years has led to tremendous growth in almost-RESTful APIs that don’t include many of the architecture’s benefits. With this practical guide, you’ll learn what it takes to design usable REST APIs that evolve over time. By focusing on solutions that cross a variety of domains, this book shows you how to create powerful and secure applications, using the tools designed for the world’s most successful distributed computing system: the World Wide Web.
You’ll explore the concepts behind REST, learn different strategies for creating hypermedia-based APIs, and then put everything together with a step-by-step guide to designing a RESTful Web API.
- Examine API design strategies, including the collection pattern and pure hypermedia
- Understand how hypermedia ties representations together into a coherent API
- Discover how XMDP and ALPS profile formats can help you meet the Web API "semantic challenge"
- Learn close to two-dozen standardized hypermedia data formats
- Apply best practices for using HTTP in API implementations
- Create Web APIs with the JSON-LD standard and other the Linked Data approaches
- Understand the CoAP protocol for using REST in embedded systems
Table of contents
- Praise for RESTful Web APIs
- Dedication
- Foreword
- Introduction
- 1. Surfing the Web
- 2. A Simple API
- 3. Resources and Representations
- 4. Hypermedia
-
5. Domain-Specific Designs
- Maze+XML: A Domain-Specific Design
- How Maze+XML Works
- The Collection of Mazes
- Is Maze+XML an API?
- Client #1: The Game
- A Maze+XML Server
- Client #2: The Mapmaker
- Client #3: The Boaster
- Clients Do the Job They Want to Do
- Extending a Standard
- The Mapmaker’s Flaw
- Maze as Metaphor
- Meeting the Semantic Challenge
- Where Are the Domain-Specific Designs?
- If You Can’t Find a Domain-Specific Design, Don’t Make One
- Kinds of API Clients
- 6. The Collection Pattern
- 7. Pure-Hypermedia Designs
- 8. Profiles
-
9. The Design Procedure
- Two-Step Design Procedure
- Seven-Step Design Procedure
- Example: You Type It, We Post It
- Some Design Advice
- Adding Hypermedia to an Existing API
- Alice’s Second Adventure
- 10. The Hypermedia Zoo
- 11. HTTP for APIs
- 12. Resource Description and Linked Data
- 13. CoAP: REST for Embedded Systems
-
A. The Status Codex
- Problem Detail Documents
- Families of Status Codes
- Four Status Codes: The Bare Minimum
- 1xx: Informational
- 2xx: Successful
- 3xx: Redirection
-
4xx: Client-Side Error
- 400 (Bad Request)
- 401 (Unauthorized)
- 402 (Payment Required)
- 403 (Forbidden)
- 404 (Not Found)
- 405 (Method Not Allowed)
- 406 (Not Acceptable)
- 407 (Proxy Authentication Required)
- 408 (Request Timeout)
- 409 (Conflict)
- 410 (Gone)
- 411 (Length Required)
- 412 (Precondition Failed)
- 413 (Request Entity Too Large)
- 414 (Request-URL Too Long)
- 415 (Unsupported Media Type)
- 416 (Requested Range Not Satisfiable)
- 417 (Expectation Failed)
- 428 (Precondition Required)
- 429 (Too Many Requests)
- 431 (Request Header Fields Too Large)
- 451 (Unavailable For Legal Reasons)
- 5xx: Server-Side Error
-
B. The Header Codex
- Custom HTTP Headers
-
The Headers
- Accept
- Accept-Charset
- Accept-Encoding
- Accept-Language
- Accept-Ranges
- Age
- Allow
- Authorization
- Cache-Control
- Connection
- Content-Disposition
- Content-Encoding
- Content-Language
- Content-Length
- Content-Location
- Content-MD5
- Content-Range
- Content-Type
- Cookie
- Date
- ETag
- Expect
- Expires
- From
- Host
- If-Match
- If-Modified-Since
- If-None-Match
- If-Range
- If-Unmodified-Since
- Last-Modified
- Link
- Link-Template
- Location
- Max-Forwards
- Pragma
- Prefer
- Preference-Applied
- Proxy-Authenticate
- Proxy-Authorization
- Range
- Referer
- Retry-After
- Set-Cookie
- Slug
- TE
- Trailer
- Transfer-Encoding
- Upgrade
- User-Agent
- Vary
- Via
- Warning
- WWW-Authenticate
- C. An API Designer’s Guide to the Fielding Dissertation
- Glossary
- Index
- Colophon
- Copyright
Product information
- Title: RESTful Web APIs
- Author(s):
- Release date: September 2013
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449358068
You might also like
book
40 Algorithms Every Programmer Should Know
Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …
book
Software Engineering at Google
Today, software engineers need to know not only how to program effectively but also how to …
book
Head First Design Patterns, 2nd Edition
You know you don’t want to reinvent the wheel, so you look to design patterns—the lessons …
book
Fundamentals of Software Architecture
Salary surveys worldwide regularly place software architect in the top 10 best jobs, yet no real …