Building an external HTTP-based API in Rails

If you’ll be in or near Raleigh the evening of March 12th, consider dropping by the Triangle Ruby Brigade. I’ll be presenting on how to build HTTP-based APIs in Rails, including:

  • Creating an API controller
  • Wiring up versioned routes for your API
  • Protecting your API with authentication
  • Choosing a transport encoding

The question of which transport encoding to use is critical. If your API will be consumed by iOS devices, choosing binary property lists over XML or JSON can give you a 30% performance boost as well as an associated reduction in bandwidth consumption. Building an API that generates plists is straightforward with the help of a couple of Ruby gems.

I’ll be sharing code examples from a recent project that surfaced a large, multi-faceted API to hundreds of iOS devices using binary plists. I’ll also have plenty of resources for those interested in learning more. It’s sure to be a great time! Hope to see you there.