5 This is the default method name for Lua handlers, see the optional
6 function-name in the LuaMapHandler directive to choose a different
10 r.content_type = "text/plain"
12 if r.method == 'GET' then
13 r:puts("Hello Lua World!\n")
14 for k, v in pairs( r:parseargs() ) do
15 r:puts( string.format("%s: %s\n", k, v) )
17 elseif r.method == 'POST' then
18 r:puts("Hello Lua World!\n")
19 for k, v in pairs( r:parsebody() ) do
20 r:puts( string.format("%s: %s\n", k, v) )
22 elseif r.method == 'PUT' then
23 -- use our own Error contents
24 r:puts("Unsupported HTTP method " .. r.method)
28 -- use the ErrorDocument