HttpLuaModule 获取Get和Post参数
2014-06-10 13:44
501 查看
Get方式:
Post方式:
两种方式混合
【其他备忘】
获取IP地址
当前时间
local id = tostring(ngx.var.arg_id) local type = tostring(ngx.var.arg_type)
Post方式:
ngx.req.read_body() local args = ngx.req.get_post_args() local id = tostring(args["id"]) local type = tostring(args["type"])
两种方式混合
local request_method = ngx.var.request_method local args = nil if "GET" == request_method then nginx.say("Get") args = ngx.req.get_uri_args() else nginx.say("Post") ngx.req.read_body() args = ngx.req.get_post_args() end local id = tostring(args["id"]) local type = tostring(args["type"])
【其他备忘】
获取IP地址
local ip_addr = tostring(ngx.var.remote_addr)
当前时间
tostring(os.date("%Y-%m-%d %H:%M:%S"))
相关文章推荐
- http get或者post请求获取参数
- lua在web开发中获取GET或POST参数
- Netty5.0 获取http get、post请求参数
- lua在web开发中获取GET或POST参数
- Nginx服务器中使用lua获取get或post参数
- lua获取get或post参数
- XMLHttpRequest.open();第一个参数post,get有什么不同,什么时候选什么,还有其他的,都有什么区别?
- 在ASP.NET中获取参数POST和GET方式提交的参数 .
- HTTP协议规范的get和post对传递的参数的最大长度没有限制
- 路径参数函数:路径的获取(GetModuleFileName)和拆分(_splitpath)
- 使用Post和Get方式传输HTTP参数
- PHP Module中获取$_GET/$_POST/$_COOKIE的方法研究
- HttpServlet- 读取表单参数Get&Post
- asp.net自定义获取Get和Post请求的参数
- 可以获取get post url 传递参数的统一方法
- 使用HttpURLConnection开发自动发送Get、Post请求并获取响应
- fcgi/cgi 参数获取 get与post
- Android http get/post传递参数
- 在ASP.NET中获取参数POST和GET方式提交的参数
- 通过Http协议以Get和Post方式获取服务器端文本数据