mnd-http-client
v0.0.1
Published
node http client
Downloads
2
Readme
Installation
In Node.js:
var HttpClient = require('mnd-http-client');
var client = new HttpClient();
var data = 'a=1';
var _header = {'Cookie':'xxx'};
client.post(url,data,function(error,result,response) {
if(error==null){
//var jsonObj = JSON.parse(result);
//console.log(jsonObj);
callOtherFunc(response.headers['set-cookie']);
}else{
console.log(error);
}
});
client.get(url,function(error,result,response) {
if(error==null){
//var jsonObj = JSON.parse(result);
//console.log(jsonObj);
}else{
console.log(error);
}
},null,_header);