18.05.2021, 05:37
Try this:
Code:
require('json')
http = require('socket.http')
url= 'http://192.168.2.11/api/dxs.json?dxsEntries=33556229'
res = http.request(url)
data = json.pdecode(res)
if type(data) ~= 'table' then
alert('failed to load data')
return
end
if data.error then
log('error', data.error)
return
end
dxsEntries = data.dxsEntries[1] -- first array/table element
log(dxsEntries)
grp.checkwrite('32/4/10', dxsEntries.value)