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(s) server as REST api?
#8
Example for writing to group addresses without password.
You have to enable FTP server in System Config, connect via FTP by using apps username and upload write.lp file into public directory.
write.lp file contents:
Code:
<?
require('apps')
addr = getvar('addr') or ''
value = getvar('value') or ''
value = json.pdecode(value)
if type(value) ~= nil then
  grp.write(addr, value)
end

Example URLs:
http://LM_IP/public/write.lp?addr=1/1/1&value=1 - write 1/ON to 1/1/1
http://LM_IP/public/write.lp?addr=32/1/1&value=123 - write 123 to 32/1/1
Reply


Messages In This Thread
http(s) server as REST api? - by Hert - 03.02.2021, 10:30
RE: http(s) server as REST api? - by admin - 03.02.2021, 10:31
RE: http(s) server as REST api? - by Hert - 03.02.2021, 10:41
RE: http(s) server as REST api? - by Hert - 05.02.2021, 19:32
RE: http(s) server as REST api? - by admin - 06.02.2021, 09:41
RE: http(s) server as REST api? - by Hert - 06.02.2021, 14:16
RE: http(s) server as REST api? - by admin - 06.02.2021, 14:20
RE: http(s) server as REST api? - by admin - 08.02.2021, 07:20
RE: http(s) server as REST api? - by idhe - 28.04.2021, 14:56
RE: http(s) server as REST api? - by admin - 29.04.2021, 07:31

Forum Jump: