mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
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:
parent
510fab7b8f
commit
11523a6ced
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user