-- ********************************************************************** -- * simple http post -- * requestdata demo -- ********************************************************************** -- require nothing local WebRoot = "webapps/demo2/web/" local CloseSession = "KEEP" function LUNAAPI_GET(requestheader,requestdata) return {filename=WebRoot.."login.html"} end function LUNAAPI_POST(requestheader,requestdata) local reqdatastr = "" if requestdata then table.foreach(requestdata, function (k,v) reqdatastr = reqdatastr .. "

" .. k .. " = " .. v .. "

" end) end CloseSession = "CLOSE" local rsp = [[

Request

]]..reqdatastr .. [[

Information

]].. "

Command: "..requestheader.command.."

".. "

Version: "..requestheader.version.."

".. "

Document: "..requestheader.document.."

".. "

IP address: "..requestheader.remoteip.."

".. "

Port: "..requestheader.remoteport.."

".. "

Session ID: "..requestheader.sessionid.."

".. "" return { type="text/html", cache="no-cache", responseno=200, length=string.len(rsp), encoding="ISO-8859-1", version="HTTP/1.1", language="ENG", content=rsp } end function LUNAAPI_SESSIONCLOSEQUERY(requestheader,requestdata) return CloseSession end