Is there an error member of your expected JSON in decodedData?
Honestly, you can learn a lot more by making this simple change:
function db.download\_users() local URL = IP.."/app1Api/User" local function networkListener( event ) print( json.prettify( event ) ) if (event.isError) then print(event.response) else local decodedData = json.decode(event.response) if(decodedData.error ~= nil) then else for k,v in pairs(decodedData) do end end end end network.request(URL, "GET",networkListener) end
Dumping the whole event table will tell you a lot. Is the URL timing out or bad? Is the web server on the other end working but giving you a 404 error because the page doesn’t exist? Help us with that information so we can help you…
Is there an error member of your expected JSON in decodedData?
Honestly, you can learn a lot more by making this simple change:
function db.download\_users() local URL = IP.."/app1Api/User" local function networkListener( event ) print( json.prettify( event ) ) if (event.isError) then print(event.response) else local decodedData = json.decode(event.response) if(decodedData.error ~= nil) then else for k,v in pairs(decodedData) do end end end end network.request(URL, "GET",networkListener) end
Dumping the whole event table will tell you a lot. Is the URL timing out or bad? Is the web server on the other end working but giving you a 404 error because the page doesn’t exist? Help us with that information so we can help you…