Classy Web Development with Sinatra Episode 2: A REST Service

Posted in Development, Frameworks, Web Technologies, Databases on February 04, 2009


Classy Web Development with Sinatra Episode 2: A REST Service

Sinatra is also great for writing (lots of) small REST services. In this episode, we’ll write a simple REST service that lets us create, read, update, and delete quips and quotes. You’ll learn how to:

  • Create a basic REST service with Sinatra
  • Write handlers to create, read, update, and delete resources
  • Use Active Record with Sinatra for database persistence
  • Respond to requests with XML or JSON formats
  • Use the RestClient library to interact with the REST service
  • Make an Atom feed
  • Protect resources with basic HTTP authentication
  • Use the last_modified helper to improve performance
  • Define a custom 404 and error handler

Watch Video

Tags: Ruby, Frameworks, xml, JSON, REST, ActiveRecord, The Pragmatic Programmers, Sinatra