1

I (try to) run a node.js app on cloud9 (c9.io). It requires express.
It hosts a html file
app.get('/index.html', function(req, res){ res.sendfile('./client/index.html'); });
which includes a form
<form action="/myaction" method="post"> <input type="text" id="name" name="name"... <input type="submit" value="Send message" />

I manage to hit the button, send a HTTP POST request with parameter name="somevalue" - which is prooven by Firebug Network Monitoring. BUT when I log the recieved req-object
app.post('/myaction', function(req1, res) { //res.send('You sent the name "' + req.body.name + '".'); res.send("das der req " + req1 + "."); console.log(req1); });

it looks like a mess: http://pastebin.com/iq7mfueC - I can't find the name Parameter, because I can't find the form at all.

MrMuc Mic
  • 11
  • 2
  • possible duplicate of [how to get POST query in express node.js?](http://stackoverflow.com/questions/5710358/how-to-get-post-query-in-express-node-js) – Joe Feb 11 '15 at 12:54
  • Either listen for `data` events yourself and reconstruct the payload or use the `body-parser` module. – Joe Feb 11 '15 at 12:55
  • Thank you very much, Joe. It is indeed a duplicate. – MrMuc Mic Feb 11 '15 at 13:23

0 Answers0