node-xhr
v1.0.5
Published
Asynchronous HTTP request utility for node, just like XMLHttpRequest.
Downloads
943
Readme
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