0.0.2 • Published 10 years ago

nett v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

node-nett

Simplified HTTP request client based on Promise

var nett = require( 'nett' );
var options = { auth: { user: "username", pass: "password" } }; // optional

nett.get( "http://www.example.com", options ).then(
    function success( r ) {
        console.log( r );
    },
    function error( err ) {
        console.log( err );
    }
);

Multiple URLs

nett.get( [ "http://www.example.com", "http://www.example.org" ], options ).then(
    function success( r ) {
        console.log( r );
    },
    function error( err ) {
        console.log( err );
    }
);

POST

nett.post( "http://www.example.com", {foo:"bar"}, options ).then( function success(response){
    console.log( response );
}, function error(err){
    console.log( err );
} );
0.0.2

10 years ago

0.0.1

11 years ago