google-api-batch-utils
Utility functions for creating request bodies and parsing batch responses for Google's REST APIs.
Example usage
List the latest three messages in a user's inbox, and then get a snippet of each message in a batch request to the Gmail API:
var rp = ;var batchUtils = ;var createBatchBody = batchUtilscreateBatchBody;var parseBatchResponse = batchUtilsparseBatchResponse; var BOUNDARY = 'example_boundary'; ;// => // [ // { snippet: 'Numberphile has uploaded The iPhone of Slide Rules - Numberphile Thanks Audible: http://www....' },// { snippet: 'Feel the bern' },// { snippet: 'See what is new with your LinkedIn connections...' } // ]
API
/*** Takes an array of API call objects and generates a string that can be used* as the body in a call to Google batch API.* @param* @param* @param* @param* @param* @param* @return */; /*** Parses a raw string response from the Google batch API into objects.* @param* @return */;
Licence
MIT