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.

Lua webrequest library (FW 2022 and later)
#8
I might have done something wrong, but it looks like the webrequest library does not work in an .lp file?

This script works fine in an event script, but returns an empty reply from server when doing a GET from the .lp file.

The SL is running FW 3.0.0


------ example.lp ------

Code:
<script src="/apps/js/localbus.js.gz"></script>
<script src="/scada/vis/busdecode.js.gz"></script>

<? require('apps') ?>

<?
webrequest = require('webrequest')
vars = {
  plugin = 'modbus',
  request = 'profile-list'
}

res = webrequest('general', 'plugin', vars)
print(res)
?>
Reply


Messages In This Thread
RE: Lua webrequest library (FW 2022 and later) - by lestole - 05.02.2024, 14:10

Forum Jump: