In the Wiki tutorial for HTTPAsync how to use, we are given an exmaple of how to use POST and GET to a certain website.

However, from my knowledge, just sending a POST request will not do anything. The POST request, once received by the website, should be stored in a $_POST variable. This was verified by myself individually setting up the website, and seeing that after one test of the script, the website had ABSOLUTELY NOTHING changed to it

Yes, I have HttpService enabled, I have checked that.

Here is the code from the wiki that I copied just as a beginner step to see how this works.

myTable = {}
myTable["exp"] = 1100
myTable["gold"] = 999
myTable["swordID"] = 1000398
 
-- Initialize an HTTP Service pointer
hs = game:GetService("HttpService")
-- Encodes the Table into a JSON string.
myTableJSON = hs:JSONEncode(myTable)

hs:PostAsync("http://--[[Link hidden for privacy reasons]]", myTableJSON)




wait(20)

myTableJSON = hs:GetAsync("http://--[[Hid link for privacy reasons]", true)
-- Decodes the JSON String we just received into a Lua Table.
myTable = hs:JSONDecode(myTableJSON) --Errored saying that it could not be converted, which I'm assuming is due to the fact that my website literally had nothing.
-- Returns myTable, which looks like {"exp"=1100, "gold"=999, "swordID" = 1000398}

for i, v in pairs(myTable) do
	print(i, v)
end

I just need one example that shows both the response to a POST and GET request, and I can work MILES off of that. Thanks in advance!

1 comment

0

The server is responsible for doing something. If the server didn't decide to change anything, nothing will change. I obviously can't POST roblox.com/?user=bluetaslem&robux=1000000 because the server isn't interested in hearing about that.