duplicate http get or post params into msg.payload to make life easier for debug etc. other properties remain as-is

This commit is contained in:
Dave C-J 2013-11-14 13:25:12 +00:00
parent 510fab7b8f
commit 11523a6ced
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ function HTTPIn(n) {
var node = this;
this.callback = function(req,res) {
node.send({req:req,res:res});
if (node.method == "post") { node.send({req:req,res:res,payload:req.body}); }
else if (node.method == "get") { node.send({req:req,res:res,payload:req.query}); }
else node.send({req:req,res:res});
}
if (this.method == "get") {
RED.app.get(this.url,this.callback);