在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
request请求处理 通过mod_lwt模块提供的处理程序来调用Lua脚本处理HTTP请求。具体流程:
request请求的各种值:
1 require "httpd" 2 local request_fields = { "uri", "protocol", "hostname", "path", "path_info", "args", 3 "method", "filename", "filedir", "user", "auth_type", 4 "local_ip", "remote_ip" } 5 request, args = ... 6 httpd.set_content_type("text/plain; charset=utf8") 7 httpd.write("Hello Lua World\r\n") 8 httpd.write("\n") 9 httpd.write("----------------------------------") 10 httpd.write("\n") 11 for _, key in ipairs(request_fields) do 12 httpd.write(key .." -> " .. (request[key] or "(not set)") .. "\r\n") 13 end 14 httpd.write("----------------------------------")
|
请发表评论