I've tried to translate the api of Pushalot application (https://pushalot.com/api) in javascript but it doesn't want to work : This is my code:
var url = 'https://pushalot.com/api/sendmessage';
var request = require('request');
request({
'uri': url,
'method': 'post',
'body' : "push",
'AuthorizationToken=' : token,
'headers' :{ 'content-Length' : data_lenght}
}
,function(error, response, body)
{
if (!error || response.statusCode == 200)
{
console.log("Push envoye : " + command);
callback({'tts' : body});
}
}
Help me please !!