Meteor.http.call Method

I am trying to insert data into MongoLab using

  if (Meteor.is_server) {
 Meteor.startup(function () {
// code to run on server at startup
 var result = Meteor.http.call("POST",  "url",
 {params:{"name" : "def"},headers:{"content-type":"application/json"}}, function      (error,result) {
              console.log(result);
            });

     });

}

I get a
   data error : {message: 'Could not parse JSON, please double check the syntax and encoding: \ nname = def \ n ^'}

+5
source share
1 answer

Thank.

The problem was solved by replacing the "parameters" with "data".

+6
source

All Articles