Here is my valid cURL command:
curl 'https://www.example.com/api/' --data '{"jsonrpc":"2.0","method":"getObjectsByFilter","id":"3"}'
here is what I tried in Node.js:
var url = 'https://www.example.com/api/';
var data = {
"jsonrpc":"2.0",
"id":"3"
};
req.post({ url: url, form: data}, function (err, result, body) {
But it is not valid.