Reputation: 161
I am trying to insert data in 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 am getting error
data: { message: 'Could not parse JSON, please double-check syntax and encoding: \nname=def\n ^' }
Upvotes: 5
Views: 4196
Reputation: 161
Thank you.
The problem solved by replacing 'params' with 'data'.
Upvotes: 6