0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 02:53:49 +01:00

Create base files in rest subdirectory.

This commit is contained in:
Wouter R 2013-07-05 17:26:39 +02:00
parent ef87b18ed9
commit c0b06a77fb
2 changed files with 21 additions and 0 deletions

21
src/rest/request.lua Normal file
View File

@ -0,0 +1,21 @@
local M = {}
local urlcode = require("util.urlcode")
function M:new()
--parse os.getenv("QUERY_STRING")
--parse os.getenv("REPLY")?
--parse arg
local qs = os.getenv("QUERY_STRING")
local urlargs = {}
urlcode.parsequery(qs, urlargs)
--supplement urlargs with arguments from the command-line
for _, v in ipairs(arg) do
local split = v:find("=")
if split ~= nil then
urlargs[v:sub(1, split - 1)] = v:sub(split + 1)
end
end
end

0
src/rest/response.lua Normal file
View File