1

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 !!

  • Look here :) http://stackoverflow.com/questions/3258645/pass-request-headers-in-a-jquery-ajax-get-call – Mr.TK Mar 13 '14 at 17:11
  • thks for the quick answer but i would like to know if my code is a good translation of the pushalot api =/ – user3416497 Mar 13 '14 at 17:44

0 Answers0