Hey guys.
I’m trying to send some JSON data to my SQL server through the frontend of my site. The code is “working” so to speak, but my server seems to dislike the information.
Here’s what I have:
local function networkListener( event ) local sendInfo = { ["email"] = "johndoe@hotmail.com", ["points"] = 3000, ["key"] = "7906145694e6035f5d51df1d0c1e0671b28a9448ecb7e7ecf0d8" } local params = {} params.body = json.encode( sendInfo ) local headers = { ["Content-Type"] = "application/json", ["Accept-Language"] = "en-US", ["Content-Length"] = #params.body } params.headers = headers network.request( "http://www.mywebsite.co.uk/index.php?", "POST", networkRequestListener, params) end
Now my web developer (who made the module to insert the data) told me to send the data in this format:
"The parameters are as following:
>> - email: string
>> - points: integer
>> - key: string (as generated in the backend)"
The data is being received, but it seems to be in the wrong format.
It’s no doubt something silly (my inexperience), but any help would be great appreciated!
Cheers