Meteor.http.call 方法 [英] Meteor.http.call method
本文介绍了Meteor.http.call 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用
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);
});
});
}
出现错误
数据:{消息:'无法解析JSON,请仔细检查语法和编码:\nname=def\n ^' }
I am getting error
data: { message: 'Could not parse JSON, please double-check syntax and encoding: \nname=def\n ^' }
推荐答案
谢谢.
通过将params"替换为data"解决的问题.
The problem solved by replacing 'params' with 'data'.
这篇关于Meteor.http.call 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文