HTTP请求中出现“无效的身份验证凭据”错误

我正在使用Fortnite Tracker API创建一个Discord机器人,我使用Lua和coro-http编写代码。当我运行代码时,它返回“无效的身份验证凭据”错误,虽然我知道密钥是正确的。

我已经尝试查看我的电子邮件是否有遗漏的内容,或者搜索返回错误的文档,但什么都没有找到。

如果有帮助的话,这是我的代码:

local http = require('coro-http')

local url = "https://api.fortnitetracker.com/v1/profile/pc/SSundee"
local key = {{"TRN-Api-Key:mykey"}}

local co = coroutine.wrap(function()
    local result, body = http.request("GET", url, key) 
    print(body)
end)

co()

我期望得到一些详细信息,但实际上却得到了 '{"message":"无效的身份验证凭据"}'

希望得到帮助!

点赞
用户11285364
用户11285364

We do not know your API key, only you do, meaning we can't tell you. If it says Invalid authentication credentials its most likey a invaild key. (It would be more help if you included the documentation) Check the documentation to make sure if your formatting it, copy and paste the key again. If none of those work, if they have a forums post it on there forums as they will know way more then we will. If they don't have a forum or the forums are no help, contact there support team.

我们不知道您的 API 密钥,只有您知道,这意味着我们无法告诉您。如果显示“Invalid authentication credentials”的话,很可能是无效的密钥。(如果您包括了文档,可能会更有帮助)请检查文档以确保您格式正确,再复制和粘贴密钥。如果这些都不起作用,如果他们有论坛,请在那里发布帖子,因为他们会比我们知道更多。如果他们没有论坛或论坛无法提供帮助,请联系他们的支持团队

2019-03-31 14:46:21