Buying Options
RESTful Web Services Cookbook

Save a Tree - Go Digital What is this?

Ebook $31.99
Add to Cart
Print+Ebook $43.99
Add to Cart
Print $39.99
Add to Cart
Print £30.99 What is this?
Add to Cart
Safari Books Online
Read Now >
Description

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.

Full Description
Table of Contents
  1. Chapter 1 Using the Uniform Interface

    1. How to Keep Interactions Visible

    2. When to Trade Visibility

    3. How to Maintain Application State

    4. How to Implement Safe and Idempotent Methods on the Server

    5. How to Treat Safe and Idempotent Methods in Clients

    6. When to Use GET

    7. When to Use POST

    8. How to Create Resources Using POST

    9. When to Use PUT to Create New Resources

    10. How to Use POST for Asynchronous Tasks

    11. How to Use DELETE for Asynchronous Deletion

    12. When to Use Custom HTTP Methods

    13. When and How to Use Custom HTTP Headers

  2. Chapter 2 Identifying Resources

    1. How to Identify Resources from Domain Nouns

    2. How to Choose Resource Granularity

    3. How to Organize Resources into Collections

    4. When to Combine Resources into Composites

    5. How to Support Computing/Processing Functions

    6. When and How to Use Controllers to Operate on Resources

  3. Chapter 3 Designing Representations

    1. How to Use Entity Headers to Annotate Representations

    2. How to Interpret Entity Headers

    3. How to Avoid Character Encoding Mismatch

    4. How to Choose a Representation Format and a Media Type

    5. How to Design XML Representations

    6. How to Design JSON Representations

    7. How to Design Representations of Collections

    8. How to Keep Collections Homogeneous

    9. How to Use Portable Data Formats in Representations

    10. When to Use Entity Identifiers

    11. How to Encode Binary Data in Representations

    12. When and How to Serve HTML Representations

    13. How to Return Errors

    14. How to Treat Errors in Clients

  4. Chapter 4 Designing URIs

    1. How to Design URIs

    2. How to Use URIs As Opaque Identifiers

    3. How to Let Clients Treat URIs As Opaque Identifiers

    4. How to Keep URIs Cool

  5. Chapter 5 Web Linking

    1. How to Use Links in XML Representations

    2. How to Use Links in JSON Representations

    3. When and How to Use Link Headers

    4. How to Assign Link Relation Types

    5. How to Use Links to Manage Application Flow

    6. How to Deal with Ephemeral URIs

    7. When and How to Use URI Templates

    8. How to Use Links in Clients

  6. Chapter 6 Atom and AtomPub

    1. How to Model Resources Using Atom

    2. When to Use Atom

    3. How to Use AtomPub Service and Category Documents

    4. How to Use AtomPub for Feed and Entry Resources

    5. How to Use Media Resources

  7. Chapter 7 Content Negotiation

    1. How to Indicate Client Preferences

    2. How to Implement Media Type Negotiation

    3. How to Implement Language Negotiation

    4. How to Implement Character Encoding Negotiation

    5. How to Support Compression

    6. When and How to Send the Vary Header

    7. How to Handle Negotiation Failures

    8. How to Use Agent-Driven Content Negotiation

    9. When to Support Server-Driven Negotiation

  8. Chapter 8 Queries

    1. How to Design URIs for Queries

    2. How to Design Query Responses

    3. How to Support Query Requests with Large Inputs

    4. How to Store Queries

  9. Chapter 9 Web Caching

    1. How to Set Expiration Caching Headers

    2. When to Set Expiration Caching Headers

    3. When and How to Use Expiration Headers in Clients

    4. How to Support Caching for Composite Resources

    5. How to Keep Caches Fresh and Warm

  10. Chapter 10 Conditional Requests

    1. How to Generate Last-Modified and ETag Headers

    2. How to Implement Conditional GET Requests in Servers

    3. How to Submit Conditional GET and HEAD Requests from Clients

    4. How to Implement Conditional PUT Requests in Servers

    5. How to Implement Conditional DELETE Requests in Servers

    6. How to Make Unconditional GET Requests from Clients

    7. How to Submit Conditional PUT and DELETE Requests from Clients

    8. How to Make POST Requests Conditional

    9. How to Generate One-Time URIs

  11. Chapter 11 Miscellaneous Writes

    1. How to Copy a Resource

    2. How to Merge Resources

    3. How to Move a Resource

    4. When to Use WebDAV Methods

    5. How to Support Operations Across Servers

    6. How to Take Snapshots of Resources

    7. How to Undo Resource Updates

    8. How to Refine Resources for Partial Updates

    9. How to Use the PATCH Method

    10. How to Process Similar Resources in Bulk

    11. How to Trigger Bulk Operations

    12. When to Tunnel Multiple Requests Using POST

    13. How to Support Batch Requests

    14. How to Support Transactions

  12. Chapter 12 Security

    1. How to Use Basic Authentication to Authenticate Clients

    2. How to Use Digest Authentication to Authenticate Clients

    3. How to Use Three-Legged OAuth

    4. How to Use Two-Legged OAuth

    5. How to Deal with Sensitive Information in URIs

    6. How to Maintain the Confidentiality and Integrity of Representations

  13. Chapter 13 Extensibility and Versioning

    1. How to Maintain URI Compatibility

    2. How to Maintain Compatibility of XML and JSON Representations

    3. How to Extend Atom

    4. How to Maintain Compatibility of Links

    5. How to Implement Clients to Support Extensibility

    6. When to Version

    7. How to Version RESTful Web Services

  14. Chapter 14 Enabling Discovery

    1. How to Document RESTful Web Services

    2. How to Use OPTIONS

  1. Appendix Additional Reading

    1. Books

    2. References

  2. Appendix Overview of REST

    1. Uniform Resource Identifiers

    2. Resources

    3. Representations

    4. Uniform Interface

    5. Hypermedia and Application State

  3. Appendix HTTP Methods

    1. OPTIONS

    2. GET

    3. HEAD

    4. POST

    5. PUT

    6. DELETE

    7. TRACE

  4. Appendix Atom Syndication Format

    1. Key Elements of Feeds and Entries

    2. Other Atom Elements to Consider

  5. Appendix Link Relation Registry

    1. alternate

    2. appendix

    3. bookmark

    4. chapter, section, subsection

    5. contents

    6. copyright

    7. current

    8. describedby

    9. edit

    10. edit-media

    11. enclosure

    12. first, last, next, next-archive, prev, previous, prev-archive, start

    13. glossary

    14. help

    15. index

    16. license

    17. payment

    18. related

    19. replies

    20. self

    21. service

    22. stylesheet

    23. up

    24. via

  6. Colophon

View Full Table of Contents
Product Details
Title:
RESTful Web Services Cookbook
By:
Subbu Allamaraju
Publisher:
O'Reilly Media / Yahoo Press
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
March 2010
Ebook Release:
February 2010
Pages:
320
Print ISBN:
978-0-596-80168-7
| ISBN 10:
0-596-80168-8
Ebook ISBN:
978-1-4493-8248-3
| ISBN 10:
1-4493-8248-7
Customer Reviews
About the Author
  1. Subbu Allamaraju

    Subbu Allamaraju is a Principal Engineer at Yahoo! where, during the last one year, he has been developing standards and practices for designing RESTful Web APIs. Prior to that Subbu developed web services/Java based software and contributed to JCP and OASIS standards at BEA Systems Inc. Subbu has contributed to four books on J2EE, all published by Wrox. For a complete list of his works, and writings, see http://www.subbu.org/about.

    View Subbu Allamaraju's full profile page.

Colophon

The animal on the cover of RESTful Web Services Cookbook is a great fringed lizard or Hatteria punctata. Hatteria, more commonly known as tuatara, are endemic to New Zealand; "tuatara" is a native Maori word meaning "peaks on back" (referring to their spiky, or fringed, spines). The name "great fringed lizard" is a misnomer; though they resemble common lizards, tuatara are quite different anatomically, and, unlike lizards, they're nocturnal and enjoy cool weather. Misclassified as lizards by the British Museum in 1831, tuatara were reclassified by zoologist Albert G nther in 1867 as Rhynchocephala, an order from which many Mesozoic fossil species are known. In fact, some scientists refer to these reptiles, the only living representative of Rhynchocephala, as "living fossils."

Tuatara grow very slowly-they don't reach maturity until they are 13-20 years old and don't stop growing until they are about 30. It is believed that tuatara in the wild can reach the impressive age of 80 or older. Their average length is 20-31 inches and they weigh 1-3 pounds. They can be gray, olive, or brick red, and their coloring can change over their lifetime. As adults, they shed their skin at least once per year. Other physical characteristics include a diapsid skull (two openings on either side), a lack of external ears, acrodont tooth structure (meaning the teeth are fused to the jawbone-another fact that distinguishes tauatara from lizards), and a third eye. This third eye grows on top of the head-under the skin in adults-and has a retina, lens, and nerve endings, although it is not used for seeing. It is, however, sensitive to light and is thought by some to help the tuatara detect the time of day or season.

Despite an endangered status, the tuatara maintains high visibility in and around New Zealand. Until October 2006, it was featured on one side of New Zealand's 5-cent piece, but the coin has since been phased out. The reptiles also figure prominently in Maori culture; they are esteemed as ariki (god forms). According to indigenous legends, they're messengers of Whiro, the god of death and disaster, and Maori women are forbidden to eat them. They also represent tapu, the line marking all things sacred and beyond which lie potentially serious consequences (manu). Maori women have been known to tattoo lizards or tuatara near their genitals to symbolize the concept of tapu. Today, tuataras are regarded as a taonga (treasure), and as the kaitiaki (guardian) of the trails to the mental and spiritual realms that give humans life.

The cover image is from Wood's Animate Creation. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSansMonoCondensed.

  • Book cover of RESTful Web Services Cookbook