0.1.9 • Published 9 years ago

nodecaller v0.1.9

Weekly downloads
1
License
ISC
Repository
-
Last release
9 years ago

nodecaller

Allows to easily chain calls to server and test rest APIs.

Sample Usage

function done(err){
  console.log(err? ('An error occurred: ' + err) : 'Call successful');
}

var caller = new Caller('http://localhost.com:3000/api/');
caller
  .path('ok')
  .get() //Expects 200, no other checks performed
  .path('auth/login')
  .post({ 'user': 'username', 'pass': 'password123' }, function(result, next){
    //Do something with result.body, remember to call next at the end
  }) //Expects 200, will pass an object as a json request body, will call function on success
  .put(function(result, next){
    //Do something with 404 result, remember to call next at the end
  }, 404) //Sends empty PUT request to http://localhost.com:3000/api/auth/login and expects 404
  .run(done);
  

TODO :)

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago