I’ve been trying to get a game’s current servers. It says I am not able to Parse the JSON. I have been researching and it tells me I need to grab the Response Body/the string I’m trying to decode instead of the URL. I will provide images down below.
ROBLOX Serversided Code:
local HTTP = game:GetService("HttpService")
local ServerURL = "https://games.roblox.com/v1/games/5690297562/servers/Public?sortOrder=Asc&limit=25"
local ServerData = HTTP:JSONDecode(ServerURL)
print(ServerData)
So I’d have to use a proxy like glitch, then would I use HTTP:RequestAsync at all? I read some of the documentation and it looked like it would be able to get the information. Or do I just JSONDecode whatever is provided from glitch?
JSONDecode doesn’t go out and fetch the data from a URL. All it does is turn a JSON string into a Lua table. So you’ll have to use RequestAsync to first fetch the data, and then feed it into JSONDecode. And yeah, you’ll have to use a proxy if you’re hitting endpoints within the Roblox domain.