Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED] Why does my JSONDecode not work? "Can't parse JSON"?

Hey guys, tried JSONDecode today, with a little bit of help of Roblox Wiki.

I will put my code, as long as the error which is "Can't parse JSON".

Can someone correct me, if I am doing something wrong?

local HttpService = game:GetService("HttpService")

local data = HttpService:JSONDecode('http://worldclockapi.com/api/json/utc/now')

if data.message == "success" then
	print("Looks like success!")
	print(data.dayOfTheWeek)
	
	
end

Thanks in advance! By the way, this site is awesome.

1 answer

✓ Accepted answer

the only parameter of JSONDecode accepts the whole JSON file a a string/long string, NOT a url pointing towards the actual JSON

This discussion is preserved as it was. New answers, comments, and votes are closed.