<form method="POST" action="/profile">
<input name="name" type="text"><br/>
<input name="password" type="password"><br/>
<input type="submit">
</form>
I am trying to send a POST request to a node.js file using this form And to process the request I did the following after creating the server :
if (request.method === 'POST') {
var data = '', dataFull;
request.on('data', function (chunk) {
data += chunk;
}).on('end', function () {
dataFull = queryString.parse(data);
});
console.log(dataFull);
}
But the console just logs undefined instead of logging the object. And tried logging the data variable but it logged nothing
Can anyone explain why?