SuperAgent with promise and url pattern support.
Returns an ES6 promise if no callback is specified.
request.get('/api/pets').end().then(function(res) {
// do something with res
}).catch(function(err) {
// caught an error
});
Creates a reusable url pattern based agent. Unspecified keys will be removed from the url.
var pets = request.api('/pets/:id');
// GET /pets
pets.get().end()
// GET /pets/1
pets.get({id: 1}).end()
// POST /pets
pets.post({name: 'Old Yeller'}).end();
// PATCH /pets/1
// id is not included in body
pets.patch({id: 1, name: 'New Yeller'}).end();