O'Reilly logo

Enterprise Rails by Dan Chak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17. REST Primer

REST, which stands for Representational State Transfer, is not a protocol. Born out of a chapter of the Ph.D. dissertation of Roy Fielding, one of the original architects of the Web, it is more of a description of how the HTTP protocol was meant to be used. REST has been given a lot of attention recently, especially in the Rails community, which has thrown its support behind REST with ActiveResource. Rails developers can be expected to, by and large, use ActiveResource, since it is there. But there are a number of issues that application developers should be aware of before jumping on the bandwagon.

In this chapter, I’ll introduce “textbook” REST. We’ll then contrast this style of REST with what most people mean when they say REST or RESTful. Then, we’ll go over some of the issues you should be aware of when choosing to create REST interfaces. The first concern is with the way ActiveResource encourages you to create services based off of database tables; this problem is avoidable but becoming endemic. The next concern is with integration; because REST is a convention—and one no one agrees upon yet—integration with external parties can be a challenge compared with the relative ease of XML-RPC services.

REST Basics

To understand the problems REST faces, and the problems you may face if you adopt REST for your service architecture, first we must go back to the theory of REST and its original goals. Only then can we understand the challenges faced in creating REST ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required