I make a request from a php page using http.request which returns the following json array:
{“1”:[“101”],“2”:[“102”],“3”:[“103”],“4”:[“104”]}
If I understand correctly, a json array once decoded turns in to a table.
So all I am trying to do is print the values to the console. Here is the code
local response = http.request(URL)
local data = json.decode(response)
for k,v in pairs(data) do print(k,v) end
And this is what shows up on the console:
1 table: 05C69778
4 table: 05C69CA0
3 table: 05C69AE8
2 table: 05C69958
I was expecting to see
1 101
2 102
3 103
4 104
What am I doing or not doing correctly to get the desired result?
Thanks