war-http
v0.3.3
Published
A simple http & https request module
Downloads
5
Readme
war-http
Yet another simple HTTP/HTTPS request module of Node.js.Support GET,POST,PUT.
Author
Usage
npm install --save war-http
var request=require('war-http');
request(url,options,function(head,body){},postData);
Example
//test.js
var request = require('war-http');
var options = {
method: 'POST',
headers: {
'User-Agent': '',
'Referer': 'https://www.taobao.com',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'X-Requested-With': 'XMLHttpRequest'
}
};
var data = {
'foo': 'bar'
};
request('https://www.baidu.com',options,function(head,body){
console.log(body);
}, data);
then
node test