RESTful Web Services
Publisher: O'Reilly Media
Release Date: December 2008
Pages: 448
Read on Safari with a 10-day trial
Start your free trial now Buy on AmazonWhere’s the cart? Now you can get everything on Safari. To purchase books, visit Amazon or your favorite retailer. Questions? See our FAQ or contact customer service:
1-800-889-8969 / 707-827-7019
support@oreilly.com
"RESTful Web Services finally provides a practical roadmap for constructing services that embrace the Web, instead of trying to route around it." -- Adam Trachtenberg, PHP author and EBay Web Services Evangelist
You've built web sites that can be used by humans. But can you also build web sites that are usable by machines? That's where the future lies, and that's what RESTful Web Services shows you how to do. The World Wide Web is the most popular distributed application in history, and Web services and mashups have turned it into a powerful distributed computing platform. But today's web service technologies have lost sight of the simplicity that made the Web successful. They don't work like the Web, and they're missing out on its advantages.
This book puts the "Web" back into web services. It shows how you can connect to the programmable web with the technologies you already use every day. The key is REST, the architectural style that drives the Web. This book:
- Emphasizes the power of basic Web technologies -- the HTTP application protocol, the URI naming standard, and the XML markup language
- Introduces the Resource-Oriented Architecture (ROA), a common-sense set of rules for designing RESTful web services
- Shows how a RESTful design is simpler, more versatile, and more scalable than a design based on Remote Procedure Calls (RPC)
- Includes real-world examples of RESTful web services, like Amazon's Simple Storage Service and the Atom Publishing Protocol
- Discusses web service clients for popular programming languages
- Shows how to implement RESTful services in three popular frameworks -- Ruby on Rails, Restlet (for Java), and Django (for Python)
- Focuses on practical issues: how to design and implement RESTful web services and clients
Table of Contents
-
Chapter 1 The Programmable Web and Its Inhabitants
-
Kinds of Things on the Programmable Web
-
HTTP: Documents in Envelopes
-
Method Information
-
Scoping Information
-
The Competing Architectures
-
Technologies on the Programmable Web
-
Leftover Terminology
-
-
Chapter 2 Writing Web Service Clients
-
Web Services Are Web Sites
-
del.icio.us: The Sample Application
-
Making the Request: HTTP Libraries
-
Processing the Response: XML Parsers
-
JSON Parsers: Handling Serialized Data
-
Clients Made Easy with WADL
-
-
Chapter 3 What Makes RESTful Services Different?
-
Introducing the Simple Storage Service
-
Object-Oriented Design of S3
-
Resources
-
HTTP Response Codes
-
An S3 Client
-
Request Signing and Access Control
-
Using the S3 Client Library
-
Clients Made Transparent with ActiveResource
-
Parting Words
-
-
Chapter 4 The Resource-Oriented Architecture
-
Resource-Oriented What Now?
-
What’s a Resource?
-
URIs
-
Addressability
-
Statelessness
-
Representations
-
Links and Connectedness
-
The Uniform Interface
-
That’s It!
-
-
Chapter 5 Designing Read-Only Resource-Oriented Services
-
Resource Design
-
Turning Requirements Into Read-Only Resources
-
Figure Out the Data Set
-
Split the Data Set into Resources
-
Name the Resources
-
Design Your Representations
-
Link the Resources to Each Other
-
The HTTP Response
-
Conclusion
-
-
Chapter 6 Designing Read/Write Resource-Oriented Services
-
User Accounts as Resources
-
Custom Places
-
A Look Back at the Map Service
-
-
Chapter 7 A Service Implementation
-
A Social Bookmarking Web Service
-
Figuring Out the Data Set
-
Resource Design
-
Design the Representation(s) Accepted from the Client
-
Design the Representation(s) Served to the Client
-
Connect Resources to Each Other
-
What’s Supposed to Happen?
-
What Might Go Wrong?
-
Controller Code
-
Model Code
-
What Does the Client Need to Know?
-
-
Chapter 8 REST and ROA Best Practices
-
Resource-Oriented Basics
-
The Generic ROA Procedure
-
Addressability
-
State and Statelessness
-
Connectedness
-
The Uniform Interface
-
This Stuff Matters
-
Resource Design
-
URI Design
-
Outgoing Representations
-
Incoming Representations
-
Service Versioning
-
Permanent URIs Versus Readable URIs
-
Standard Features of HTTP
-
Faking PUT and DELETE
-
The Trouble with Cookies
-
Why Should a User Trust the HTTP Client?
-
-
Chapter 9 The Building Blocks of Services
-
Representation Formats
-
Prepackaged Control Flows
-
Hypermedia Technologies
-
-
Chapter 10 The Resource-Oriented Architecture Versus Big Web Services
-
What Problems Are Big Web Services Trying to Solve?
-
SOAP
-
WSDL
-
UDDI
-
Security
-
Reliable Messaging
-
Transactions
-
BPEL, ESB, and SOA
-
Conclusion
-
-
Chapter 11 Ajax Applications as REST Clients
-
From AJAX to Ajax
-
The Ajax Architecture
-
A del.icio.us Example
-
The Advantages of Ajax
-
The Disadvantages of Ajax
-
REST Goes Better
-
Making the Request
-
Handling the Response
-
JSON
-
Don’t Bogart the Benefits of REST
-
Cross-Browser Issues and Ajax Libraries
-
Subverting the Browser Security Model
-
-
Chapter 12 Frameworks for RESTful Services
-
Ruby on Rails
-
Restlet
-
Django
-
-
Appendix Some Resources for REST and Some RESTful Resources
-
Standards and Guides
-
Services You Can Use
-
-
Appendix The HTTP Response Code Top 42
-
Three to Seven Status Codes: The Bare Minimum
-
1xx: Meta
-
2xx: Success
-
3xx: Redirection
-
4xx: Client-Side Error
-
5xx: Server-Side Error
-
-
Appendix The HTTP Header Top Infinity
-
Standard Headers
-
Nonstandard Headers
-
-
Colophon