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_modifiedhelper to improve performance - Define a custom 404 and error handler