In this article I am going to talk about a useful API development technique called Partial Response which can be used in Ruby Grape API’s to allow clients retrieving just the amount information they need instead of the full resource representation. This techinque reduces bandwidth usage and increases client efficiency and responsiveness, specially in mobile devices.
This is the first part of a series of posts I am going to write about crafting Ruby API’s with the Grape framework.
The most common approach to Partial Response is to include a fields=field1,field2,field-n parameter in the request specifing the necessary fields.
Continue Reading →