Convert JSON String to Lua Table?

maybe lua-cjsonis your friend:

install e.g. through luarocks:

$sudo luarocks install lua-cjson

then in lua:

local json = require('cjson')
local tab = json.decode(json_string)
json_string = json.encode(tab)

Leave a Comment