I'm finally forcing myself to learn Http Requests. I'm referencing Roblox TOS ingame so in case the TOS is updated I want a warning message to appear and a way to view it, also ingame.
Here is my attempt:
local HttpService = game:GetService("HttpService")
-- removed 11 unrelated lines --
function game.ReplicatedStorage.Functions.GetTOS.OnServerInvoke(player)
local results = HttpService:RequestAsync({
URL = "https://en.help.roblox.com/hc/en-us/articles/203313410-Roblox-Community-Rules",
Method = "GET",
Headers = {
["Content-Type"] = "text/plain"
}
})
return results
end
However this generates this error.
09:36:14.651 - Unrecognized request option URL 09:36:14.672 - Stack Begin 09:36:14.676 - Script 'ServerScriptService.WebLoader', Line 15 - function OnServerInvoke 09:36:14.678 - Stack End
My best guess is that I'm trying to request a normal webpage and not JSON. If that's the case how could I work around it? I will be doing this for more then just the TOS so a universal method would be preferable.
#Edit: Turns out its case sensitive.
