This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

http request json (dxsEntries) Kostal
#2
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)
Reply


Messages In This Thread
RE: http request json (dxsEntries) Kostal - by admin - 18.05.2021, 05:37

Forum Jump: