I would like to send let's say 2 variables to node js server. I know how to do it with one... But if I want to send two datas, which could be separately read in node and then written into xml file the method I used doesnt work.
http.createServer(function (req, res) {
if (req.method === "POST") {
req.on('data', function (data) {
requestData += data;
console.log(data.toString());
fs.appendFile('name.xml','<XML>' + data + '\n</XML>', function (err) {
});
});
}
That was node js code sample how I get data from ajax call.
var info2value = $('#edittocatch').val();
var colorvalue = $('#catchColor').val();
$.ajax({
type: "POST",
url: 'http://127.0.0.1:5073/',
data: info2value
});
And now what should I do to send data2 data3 etc?