Quester
Let's go on a (re)quest.
What is Quester?
Quester is a smallish wrapper around Request that makes it easy to make batch requests and handle the response as one unit.
It also has support for depdendencies between requests. So POST data or parameters from a request can be used as data to another request. This is done using JSONPath.
Installation
Install using npm per usual.
npm install quester --save
Example Usage
The Quester API is pretty simple. This is how you make a GET request.
var quester = ;var client = 'http://base.url.for.api.com/api'; client ;
Making batch requests
Quester makes it easy to make a bunch of requests at once and process them in one callback.
Please don't mind the terrible HTTP API "design" below.
var quester = ;var client = 'http://base.com'; // Queue a get request with additional querystring parametersclient; // Queue a post requestclient; // Suppose '/blog' returns an object with the newly created posts id// and you have an API to get comments for a blogpost.// Setting a parameter to an object with the key "jsonpath" let's you// Add data from a previous request.client;