Make export data use GET HTTP request

This commit is contained in:
emanuele-f 2017-05-08 13:51:28 +02:00
parent ca1d85c94e
commit 3b3436eb0d
3 changed files with 9 additions and 12 deletions

View file

@ -9,16 +9,17 @@ require "lua_utils"
sendHTTPHeader('application/json')
if(_POST["export"] ~= nil) then
if _GET["ifid"] ~= nil then
interface.select(_GET["ifid"])
end
interface.select(ifname)
if((_POST["ip"] ~= nil) and (_POST["ip"] ~= "")) then
if((_GET["ip"] ~= nil) and (_GET["ip"] ~= "")) then
vlan = 0
if ((_POST["vlan"] ~= nil) and (_POST["vlan"] ~= "")) then
vlan = tonumber(_POST["vlan"])
if ((_GET["vlan"] ~= nil) and (_GET["vlan"] ~= "")) then
vlan = tonumber(_GET["vlan"])
end
host = interface.getHostInfo(_POST["ip"], vlan)
host = interface.getHostInfo(_GET["ip"], vlan)
if(host == nil) then
print("{ }\n")
@ -50,4 +51,3 @@ else
print("\n]\n")
end
end