1.0.5 • Published 10 years ago

node-xhr v1.0.5

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

node-xhr

Asynchronous HTTP request utility for node, just like XMLHttpRequest.

var xhr = require('node-xhr');

xhr.post({
    url     : 'http://localhost:3000/v1/test',
    headers : {
        'Content-Type' : 'application/json',
    },
    params  : {
        // ...
    },
    body    : {
        // ...
    },
}, function(err, res) {
    if (err) {
        console.log(err.message);
        return;
    }

    console.log(JSON.stringify(res.status));
    console.log(JSON.stringify(res.headers));
    console.log(res.body);
});

Installation

You can install it by npm install node-xhr.

Documentation

About more details, please see API doc.

License

The code under The MIT License

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago