Thursday, October 20, 2016

NodeJS HTTP Example to fetch value from Form/Screen

var http = require('http');
var uhtml = 
'Post Example' +
'' +
'Fetching Values from Form/Screen using Node JS
'+

'
' +

'Name :
' +

'Surname :
' +

'' +
'
' +
'';
http.createServer(function (req, res) {
var body = "";
req.on('data', function (chunk) {
body += chunk;
});
req.on('end', function () {
console.log('Posted Data: ' + body);
res.writeHead(200);
res.end(uhtml);
});
}).listen(1234);

image3

No comments: