RESTful Web Services Cookbook. Solutions for Improving Scalability and Simplicity - Helion
ISBN: 978-14-493-8884-3
stron: 316, Format: ebook
Data wydania: 2010-02-22
Księgarnia: Helion
Cena książki: 118,15 zł (poprzednio: 137,38 zł)
Oszczędzasz: 14% (-19,23 zł)
While the REST design philosophy has captured the imagination of web and enterprise developers alike, using this approach to develop real web services is no picnic. This cookbook includes more than 100 recipes to help you take advantage of REST, HTTP, and the infrastructure of the Web. You'll learn ways to design RESTful web services for client and server applications that meet performance, scalability, reliability, and security goals, no matter what programming language and development framework you use.
Each recipe includes one or two problem statements, with easy-to-follow, step-by-step instructions for solving them, as well as examples using HTTP requests and responses, and XML, JSON, and Atom snippets. You'll also get implementation guidelines, and a discussion of the pros, cons, and trade-offs that come with each solution.
- Learn how to design resources to meet various application scenarios
- Successfully design representations and URIs
- Implement the hypertext constraint using links and link headers
- Understand when and how to use Atom and AtomPub
- Know what and what not to do to support caching
- Learn how to implement concurrency control
- Deal with advanced use cases involving copying, merging, transactions, batch processing, and partial updates
- Secure web services and support OAuth
Osoby które kupowały "RESTful Web Services Cookbook. Solutions for Improving Scalability and Simplicity", wybierały także:
- 100 rzeczy, które każdy projektant powinien wiedzieć o potencjalnych klientach. Wydanie II 58,98 zł, (29,49 zł -50%)
- Responsive Web Design. Projektowanie elastycznych witryn w HTML5 i CSS3. Wydanie III 69,00 zł, (34,50 zł -50%)
- AngularJS. Tworzenie aplikacji webowych. Receptury 58,98 zł, (29,49 zł -50%)
- Niezawodne zasady web designu. Projektowanie spektakularnych witryn internetowych. Wydanie III 49,00 zł, (24,50 zł -50%)
- Niezawodne zasady web designu. Projektowanie spektakularnych witryn internetowych. Wydanie II 49,00 zł, (24,50 zł -50%)
Spis treści
RESTful Web Services Cookbook. Solutions for Improving Scalability and Simplicity eBook -- spis treści
- RESTful Web Services Cookbook
- SPECIAL OFFER: Upgrade this ebook with OReilly
- Preface
- Scope of the Book
- Companion Material
- How This Book Is Organized
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgments
- Mike Amundsens Contribution
- 1. Using the Uniform Interface
- 1.1. How to Keep Interactions Visible
- Problem
- Solution
- Discussion
- 1.2. When to Trade Visibility
- Problem
- Solution
- Discussion
- 1.3. How to Maintain Application State
- Problem
- Solution
- Discussion
- 1.4. How to Implement Safe and Idempotent Methods on the Server
- Problem
- Solution
- Discussion
- Implementing safe methods
- Implementing idempotent methods
- Idempotency of DELETE
- 1.5. How to Treat Safe and Idempotent Methods in Clients
- Problem
- Solution
- Discussion
- Safe methods
- Idempotent methods
- 1.6. When to Use GET
- Problem
- Solution
- Discussion
- 1.7. When to Use POST
- Problem
- Solution
- Discussion
- 1.8. How to Create Resources Using POST
- Problem
- Solution
- Discussion
- 1.9. When to Use PUT to Create New Resources
- Problem
- Solution
- Discussion
- 1.10. How to Use POST for Asynchronous Tasks
- Problem
- Solution
- Discussion
- 1.11. How to Use DELETE for Asynchronous Deletion
- Problem
- Solution
- Discussion
- 1.12. When to Use Custom HTTP Methods
- Problem
- Solution
- Discussion
- 1.13. When and How to Use Custom HTTP Headers
- Problem
- Solution
- Discussion
- 1.1. How to Keep Interactions Visible
- 2. Identifying Resources
- 2.1. How to Identify Resources from Domain Nouns
- Problem
- Solution
- Discussion
- 2.2. How to Choose Resource Granularity
- Problem
- Solution
- Discussion
- 2.3. How to Organize Resources into Collections
- Problem
- Solution
- Discussion
- 2.4. When to Combine Resources into Composites
- Problem
- Solution
- Discussion
- 2.5. How to Support Computing/Processing Functions
- Problem
- Solution
- Discussion
- 2.6. When and How to Use Controllers to Operate on Resources
- Problem
- Solution
- Discussion
- 2.1. How to Identify Resources from Domain Nouns
- 3. Designing Representations
- 3.1. How to Use Entity Headers to Annotate Representations
- Problem
- Solution
- Discussion
- Content-Type
- Content-Length
- Content-Language
- Content-MD5
- Content-Encoding
- Last-Modified
- 3.2. How to Interpret Entity Headers
- Problem
- Solution
- Discussion
- 3.3. How to Avoid Character Encoding Mismatch
- Problem
- Solution
- Discussion
- 3.4. How to Choose a Representation Format and a Media Type
- Problem
- Solution
- Discussion
- Using standard or well-known media types
- Introducing new formats and media types
- 3.5. How to Design XML Representations
- Problem
- Solution
- Discussion
- 3.6. How to Design JSON Representations
- Problem
- Solution
- Discussion
- 3.7. How to Design Representations of Collections
- Problem
- Solution
- Discussion
- 3.8. How to Keep Collections Homogeneous
- Problem
- Solution
- Discussion
- 3.9. How to Use Portable Data Formats in Representations
- Problem
- Solution
- Discussion
- Numbers
- Countries and territories
- Currencies
- Dates and times
- Language tags
- Time zone identifiers
- 3.10. When to Use Entity Identifiers
- Problem
- Solution
- Discussion
- 3.11. How to Encode Binary Data in Representations
- Problem
- Solution
- Discussion
- 3.12. When and How to Serve HTML Representations
- Problem
- Solution
- Discussion
- 3.13. How to Return Errors
- Problem
- Solution
- Discussion
- Errors due to client inputs: 4xx
- Errors due to server errors: 5xx
- Message body for errors
- 3.14. How to Treat Errors in Clients
- Problem
- Solution
- Discussion
- 3.1. How to Use Entity Headers to Annotate Representations
- 4. Designing URIs
- 4.1. How to Design URIs
- Problem
- Solution
- Discussion
- Domains and subdomains
- Forward-slash separator
- Underscore and hyphen
- Ampersand
- Comma and semicolon
- Full stop, or period
- Implementation-specific file extensions
- Spaces and capital letters
- 4.2. How to Use URIs As Opaque Identifiers
- Problem
- Solution
- Discussion
- 4.3. How to Let Clients Treat URIs As Opaque Identifiers
- Problem
- Solution
- Discussion
- 4.4. How to Keep URIs Cool
- Problem
- Solution
- Discussion
- 4.1. How to Design URIs
- 5. Web Linking
- 5.1. How to Use Links in XML Representations
- Problem
- Solution
- Discussion
- 5.2. How to Use Links in JSON Representations
- Problem
- Solution
- Discussion
- 5.3. When and How to Use Link Headers
- Problem
- Solution
- Discussion
- 5.4. How to Assign Link Relation Types
- Problem
- Solution
- Discussion
- 5.5. How to Use Links to Manage Application Flow
- Problem
- Solution
- Discussion
- 5.6. How to Deal with Ephemeral URIs
- Problem
- Solution
- Discussion
- 5.7. When and How to Use URI Templates
- Problem
- Solution
- Discussion
- 5.8. How to Use Links in Clients
- Problem
- Solution
- Discussion
- 5.1. How to Use Links in XML Representations
- 6. Atom and AtomPub
- 6.1. How to Model Resources Using Atom
- Problem
- Solution
- Discussion
- 6.2. When to Use Atom
- Problem
- Solution
- Discussion
- 6.3. How to Use AtomPub Service and Category Documents
- Problem
- Solution
- Discussion
- 6.4. How to Use AtomPub for Feed and Entry Resources
- Problem
- Solution
- Discussion
- 6.5. How to Use Media Resources
- Problem
- Solution
- Discussion
- 6.1. How to Model Resources Using Atom
- 7. Content Negotiation
- 7.1. How to Indicate Client Preferences
- Problem
- Solution
- Discussion
- 7.2. How to Implement Media Type Negotiation
- Problem
- Solution
- Discussion
- 7.3. How to Implement Language Negotiation
- Problem
- Solution
- Discussion
- 7.4. How to Implement Character Encoding Negotiation
- Problem
- Solution
- Discussion
- 7.5. How to Support Compression
- Problem
- Solution
- Discussion
- 7.6. When and How to Send the Vary Header
- Problem
- Solution
- Discussion
- 7.7. How to Handle Negotiation Failures
- Problem
- Solution
- Discussion
- 7.8. How to Use Agent-Driven Content Negotiation
- Problem
- Solution
- Discussion
- 7.9. When to Support Server-Driven Negotiation
- Problem
- Solution
- Discussion
- 7.1. How to Indicate Client Preferences
- 8. Queries
- 8.1. How to Design URIs for Queries
- Problem
- Solution
- Discussion
- 8.2. How to Design Query Responses
- Problem
- Solution
- Discussion
- 8.3. How to Support Query Requests with Large Inputs
- Problem
- Solution
- Discussion
- 8.4. How to Store Queries
- Problem
- Solution
- Discussion
- 8.1. How to Design URIs for Queries
- 9. Web Caching
- 9.1. How to Set Expiration Caching Headers
- Problem
- Solution
- Discussion
- 9.2. When to Set Expiration Caching Headers
- Problem
- Solution
- Discussion
- 9.3. When and How to Use Expiration Headers in Clients
- Problem
- Solution
- Discussion
- 9.4. How to Support Caching for Composite Resources
- Problem
- Solution
- Discussion
- 9.5. How to Keep Caches Fresh and Warm
- Problem
- Solution
- Discussion
- 9.1. How to Set Expiration Caching Headers
- 10. Conditional Requests
- 10.1. How to Generate Last-Modified and ETag Headers
- Problem
- Solution
- Discussion
- 10.2. How to Implement Conditional GET Requests in Servers
- Problem
- Solution
- Discussion
- 10.3. How to Submit Conditional GET and HEAD Requests from Clients
- Problem
- Solution
- Discussion
- 10.4. How to Implement Conditional PUT Requests in Servers
- Problem
- Solution
- Discussion
- 10.5. How to Implement Conditional DELETE Requests in Servers
- Problem
- Solution
- Discussion
- 10.6. How to Make Unconditional GET Requests from Clients
- Problem
- Solution
- Discussion
- 10.7. How to Submit Conditional PUT and DELETE Requests from Clients
- Problem
- Solution
- Discussion
- 10.8. How to Make POST Requests Conditional
- Problem
- Solution
- Discussion
- 10.9. How to Generate One-Time URIs
- Problem
- Solution
- Discussion
- 10.1. How to Generate Last-Modified and ETag Headers
- 11. Miscellaneous Writes
- 11.1. How to Copy a Resource
- Problem
- Solution
- Discussion
- 11.2. How to Merge Resources
- Problem
- Solution
- Discussion
- 11.3. How to Move a Resource
- Problem
- Solution
- Discussion
- 11.4. When to Use WebDAV Methods
- Problem
- Solution
- Discussion
- 11.5. How to Support Operations Across Servers
- Problem
- Solution
- Discussion
- 11.6. How to Take Snapshots of Resources
- Problem
- Solution
- Discussion
- 11.7. How to Undo Resource Updates
- Problem
- Solution
- Discussion
- 11.8. How to Refine Resources for Partial Updates
- Problem
- Solution
- Discussion
- 11.9. How to Use the PATCH Method
- Problem
- Solution
- Discussion
- 11.10. How to Process Similar Resources in Bulk
- Problem
- Solution
- Discussion
- 11.11. How to Trigger Bulk Operations
- Problem
- Solution
- Discussion
- 11.12. When to Tunnel Multiple Requests Using POST
- Problem
- Solution
- Discussion
- 11.13. How to Support Batch Requests
- Problem
- Solution
- Discussion
- 11.14. How to Support Transactions
- Problem
- Solution
- Discussion
- 11.1. How to Copy a Resource
- 12. Security
- 12.1. How to Use Basic Authentication to Authenticate Clients
- Problem
- Solution
- Discussion
- 12.2. How to Use Digest Authentication to Authenticate Clients
- Problem
- Solution
- Discussion
- 12.3. How to Use Three-Legged OAuth
- Problem
- Solution
- Discussion
- 12.4. How to Use Two-Legged OAuth
- Problem
- Solution
- Discussion
- 12.5. How to Deal with Sensitive Information in URIs
- Problem
- Solution
- Discussion
- 12.6. How to Maintain the Confidentiality and Integrity of Representations
- Problem
- Solution
- Discussion
- 12.1. How to Use Basic Authentication to Authenticate Clients
- 13. Extensibility and Versioning
- 13.1. How to Maintain URI Compatibility
- Problem
- Solution
- Discussion
- 13.2. How to Maintain Compatibility of XML and JSON Representations
- Problem
- Solution
- Discussion
- 13.3. How to Extend Atom
- Problem
- Solution
- Discussion
- 13.4. How to Maintain Compatibility of Links
- Problem
- Solution
- Discussion
- 13.5. How to Implement Clients to Support Extensibility
- Problem
- Solution
- Discussion
- 13.6. When to Version
- Problem
- Solution
- Discussion
- 13.7. How to Version RESTful Web Services
- Problem
- Solution
- Discussion
- 13.1. How to Maintain URI Compatibility
- 14. Enabling Discovery
- 14.1. How to Document RESTful Web Services
- Problem
- Solution
- Discussion
- 14.2. How to Use OPTIONS
- Problem
- Solution
- Discussion
- 14.1. How to Document RESTful Web Services
- A. Additional Reading
- Books
- References
- Foundation
- Atom and AtomPub
- Caching
- Formats and Media Types
- Security
- B. Overview of REST
- Uniform Resource Identifiers
- Resources
- Representations
- Uniform Interface
- Hypermedia and Application State
- C. HTTP Methods
- OPTIONS
- GET
- HEAD
- POST
- PUT
- DELETE
- TRACE
- D. Atom Syndication Format
- Key Elements of Feeds and Entries
- atom:author
- atom:content and atom:summary
- atom:id
- atom:link
- atom:title
- atom:updated
- Other Atom Elements to Consider
- atom:category
- atom:contributor
- atom:generator
- atom:icon
- atom:logo
- atom:published
- atom:rights
- atom:subtitle
- Key Elements of Feeds and Entries
- E. Link Relation Registry
- alternate
- appendix
- bookmark
- chapter, section, subsection
- contents
- copyright
- current
- describedby
- edit
- edit-media
- enclosure
- first, last, next, next-archive, prev, previous, prev-archive, start
- glossary
- help
- index
- license
- payment
- related
- replies
- self
- service
- stylesheet
- up
- via
- Index
- About the Author
- Colophon
- SPECIAL OFFER: Upgrade this ebook with OReilly