首页 > 解决方案 > Github API 更新文件时返回 404

问题描述

我正在尝试使用 roblox 的 HTTPService 更新 github 上的 JSON 文件。每当我发送 put 请求时,github 都会返回 404 状态。我制作了一个程序来更新python中的文件,它工作正常,但事实并非如此。

    local data = {
        message = "Did stuff",
        committer = {
            name = <name>,
            email = <email>
        },
        content = b64enc("{Song : "..song..", IsBroadcast = true"),
        sha = <sha>
    }
    local response = httpservice:RequestAsync(
        {
            Url = <github api url>,
            Method = "PUT",
            Headers = {
                ["auth"] = "<authorization>",
                ["Content-Type"] = "application/json",
            },
            Body = httpservice:JSONEncode(data)
        }
    )
 

标签: jsongithubauthorizationgithub-apiroblox

解决方案


推荐阅读