-- example handler require "string" --[[ This is the default method name for Lua handlers, see the optional function-name in the LuaMapHandler directive to choose a different entry point. --]] function handle(r) r.content_type = "text/plain" r:puts("Hello Lua World!\n") r:puts(apache2.version) if r.method == 'GET' then for k, v in pairs( r:parseargs() ) do r:puts( string.format("%s: %s", k, v) ) end elseif r.method == 'POST' then for k, v in pairs( r:parsebody() ) do r:puts( string.format("%s: %s", k, v) ) end else r:puts("unknown HTTP method " .. r.method) end end