如何修复在向谷歌脚本发送帖子时出现“HTTP 405”错误?

我正在尝试从ROBLOX服务器向Google脚本发出帖子请求,但是我得到了“HTTP 405”错误。这个请求在Postman(我用来测试HTTP Post请求的软件)中运行良好,但是从ROBLOX服务器提交时,我得到了HTTP 405错误。我该怎么做才能解决这个问题?

Google脚本代码

function doPost(e) {
    Logger.log("running");
    handleFunction(e.parameter);
    return ContentService.createTextOutput(JSON.stringify(e));
}

ROBLOX代码

return function(args)
    pcall(function()
        --获取时间戳
        args.Time = os.date("!*t").year .. ":" .. os.date("!*t").month .. ":" .. os.date("!*t").day .. " " .. os.date("!*t").hour .. ":" .. os.date("!*t").min .. ":" .. os.date("!*t").sec;
        args = HttpService:JSONEncode(args);
        HttpService:PostAsync(dbScript,args);
    end);
end;
点赞
用户5832311
用户5832311

根据这个论坛的信息,很可能是 Google 禁止了 Roblox 向 Google Sheets 发送数据,因为这可能被其他人滥用了。另外,尝试将你复制的 URL 放入 Roblox 模块并在浏览器中打开。从脚本编辑器 “Publish -> Deploy as web app” 应该会列出你当前的 URL。如果他们禁止了 Roblox 的服务器,这应该能够工作。

2018-12-27 14:15:59