5

我正在尝试使用在 MongoLab 中插入数据

  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);
            });

     });

}

我收到错误
数据:{ message: 'Could not parse JSON, please double check syntax and encoding: \nname=def\n ^' }

4

1 回答 1

6

谢谢你。

通过用“数据”替换“参数”解决了这个问题。

于 2012-07-04T10:05:25.073 回答