--]]
function handle(r)
r.content_type = "text/plain"
- r:puts("Hello Lua World!\n")
if r.method == 'GET' then
+ r:puts("Hello Lua World!\n")
for k, v in pairs( r:parseargs() ) do
r:puts( string.format("%s: %s\n", k, v) )
end
elseif r.method == 'POST' then
+ r:puts("Hello Lua World!\n")
for k, v in pairs( r:parsebody() ) do
r:puts( string.format("%s: %s\n", k, v) )
end
- else
+ elseif r.method == 'PUT' then
+-- use our own Error contents
r:puts("Unsupported HTTP method " .. r.method)
+ r.status = 405
+ return apache2.ok
+ else
+-- use the ErrorDocument
return 501
end
return apache2.OK