auth
var request = require("request");
request.post(
{
url:'http://user:password@127.0.0.1:8441',
json: true,
headers: {
"content-type": "application/json",
},
body:{
"id":"1",
"jsonrpc": "2.0",
"method":"XXXXXXXXXXXXXXX",
"params":[id,0]
}
},function(error,response, body){
if(response.statusCode == 200){
tx.__raw=body;
callback(null,tx);
}else{
log.error(' err ['+body.toString()+']');
return callback(new Error());
}
}
);