That error appers whenever what you pass to JSONDecode() isn’t a valid json string.
You should always wrap API calls in pcalls to handle errors
local success, result = pcall(function()
return HttpService:RequestAsync(...)
end)
if not success or not result.Success then
return warn(`Unsuccessful request, failed with status code {result.StatusCode}.`)
end
if result.Body then
print(HttpService:JSONDecode(result.Body))
end
Apparently you are receiving an error instead of the expected response which doesn’t include a valid json body. You can debug it by reading the response’s status code.
That means that the error is not in the request because the return of RequestAsync() is a table with a StatusCode key. You probably haven’t turned on HttpRequests in your game’s settings. Try printing result.