@ente34 sagte in JSON Post:
var request = require('request');
on({id: "javascript.0.Devices.Tdarr.Worker", change: 'any'}, function (obj) {
const myObj = {
"nodeID": "local",
"process": "increase",
"workerType": "transcodecpu"
};
const options = {
url: 'http://192.168.1.214:8102/api/v2/alter-worker-limit',
method: 'POST',
body:myObj,
json:true
};
request(options,function (error, response, body){
error && console.log('error:'+error);
response && console.log('response:'+response);
body && console.log('body:'+body);
});
});
Rtfm
Gemäß der doku muss es body und json heißen.
Hab den Code angepasst
https://github.com/request/request#requestoptions-callback