Unable to cast value to std::string error on RequestAsync()

I’m am currently working on my own API, and I have most of it done. But, when I attempt to return the table from it with a JSONDecode I am get a Unable to cast value to std::string error. So, I then decided to remove the JSONDecode but then I can’t get the table returned.

local checkVerified = game:GetService("ReplicatedStorage"):WaitForChild("checkVerified")
local HttpService = game:GetService("HttpService")


function checkVerified.OnServerInvoke(plr)
	local response = HttpService:RequestAsync({
		Url = "http://127.0.0.1:3000/isVerified/",
		Method = "GET",
		Headers = {
			["Username"] = plr.Name
		},
	})
	print(response)
	return HttpService:JSONDecode(response)
end
1 Like

RequestAsync returns a dictionary. JSONDecode turns a string into a table. Did you mean to do HttpService:JSONEncode(response)? Maybe HttpService:JSONDecode(response.Body)?

1 Like

Oh yes, I forgot completely about that! Thanks!

1 Like