I’m a beginner in Lua just started it. I was trying to call a restapi using lua but ,I’m facing issues
[lua]
local headers = {}
headers[“Content-Type”] = “application/json”
headers[“X-API-Key”] = “u0X9q5qPvJ42ljksahdshdjsacmMlrU8jaP2g1O”
local body = “testfromLua”
local params = {}
params.headers = headers
params.body = body
network.request("https://“Sample API Url”, “POST”, networkListener, params)
[/lua]
The error is
attempt to index local 'network' (a nil value)
so what could be the problem?
Thank you.