diff --git a/http/post.lua b/http/post.lua
index d1ac03d..2acae1b 100644
--- a/http/post.lua
+++ b/http/post.lua
@@ -1,33 +1,29 @@
return function (connection, req, args)
- connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nCache-Control: private, no-store\r\n\r\n")
- connection:send('
Arguments')
- connection:send('')
- connection:send('Arguments
')
+ dofile("httpserver-header.lc")(connection, 200, 'html')
+ connection:send([===[
+ Arguments by POSTArguments by POST
+ ]===])
- local form = [===[
-
- ]===]
-
if req.method == "GET" then
- connection:send(form)
+ connection:send([===[
+
+ ]===])
elseif req.method == "POST" then
- local rd = req.getRequestData()
- -- connection:send(cjson.encode(rd))
+ local rd = req.getRequestData()
connection:send('Received the following values:
')
connection:send("\n")
for name, value in pairs(rd) do
connection:send('- ' .. name .. ': ' .. tostring(value) .. "
\n")
end
-
connection:send("
\n")
else
- connection:send("NOT IMPLEMENTED")
+ connection:send("ERROR WTF req.method is ", req.method)
end
-
+
connection:send('')
end