我想为流星平台内建的网站做一个PredictionIO推荐。 代码是:
getUserRecommendations: function (num) {
var userId = Meteor.userId();
check(userId, String);
this.unblock();
try {
var result = HTTP.call('GET', "http://localhost:8000/queries.json",
{ params: { "user": [userId] , "num" : 4 } });
return result;
} catch (e) {
console.log(e);
return "\n" +e;
}
}
错误来自Meteor服务器:
{ [Error: failed [405] HTTP method not allowed, supported methods: POST] stack: [Getter] }
答案 0 :(得分:3)
使用POST而不是GET。您的服务器无法处理GET请求