I would like to know if it is possible to use curl with a variable. This is the code I am using:
const exec = require('child_process').exec;
function execute(command, callback) {
var a = exec('curl -F data=@/"doc.xml" https://chowlk.linkeddata.es/api', (error, stdout, stderr) => {
callback(stdout);
});
};
execute('ping -c 4 0.0.0.0', (a) => {
download("a.owl", a);
});
The code works, but where it says doc.xml I want to put a variable where I have previously saved the xml. I have tried different ways but I have not succeeded. Is it possible to pass a variable to curl?