gpt4 book ai didi

javascript - { [错误 : failed [405] HTTP method not allowed, 支持的方法:POST] 堆栈:[Getter] }

转载 作者:行者123 更新时间:2023-11-28 14:56:19 24 4
gpt4 key购买 nike

我想为一个内置 meteor 平台的网站提供 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] }

最佳答案

使用 POST 而不是 GET。您的服务器无法处理 GET 请求

关于javascript - { [错误 : failed [405] HTTP method not allowed, 支持的方法:POST] 堆栈:[Getter] },我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42666882/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com