HttpLuaModule 获取Get和Post参数
Get方式:
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"))
HttpLuaModule 获取Get和Post参数的更多相关文章
- WebForm获取GET或者POST参数到实体的转换,ADO.NET数据集自动转换实体
最近在修改维护以前的webform项目(维护别人开发的.....)整个aspx没有用到任何的控件,这个我也比较喜欢不用控件所以在提交信息的时候需要自己手动的去Request.QueryString[] ...
- 如何获取url中的参数并传递给iframe中的报表
在使用报表软件时,用户系统左边一般有目录树,点击报表节点就会在右侧网页的iframe中显示出报表,同时点击的时候也会传递一些参数给网页,比如时间和用户信息等.如何使网页中的报表能够获取到传递过来的参数 ...
- 使用JS,获取URL中指定参数的值
/** * 获取URL中指定参数的值 * * @param name 参数名称 * @returns */ function getQueryString(name) { var reg = new ...
- APPCAN开发笔记:html页面之间的参数传递:使用js获取url中的参数,以及在APPCAN中不能使用的解决方法
用PHP的GET/POST方式来传递方式已经是司空见惯了,但是如果我的页面是一个静态的html的页面,想传递参数的时候要怎么办呢?在APPCAN的开发中我们会经常遇到这样的问题,因为所有的页面都是静态 ...
- javaScript获取url中的参数
var urlTools = { //获取RUL参数值 getUrlParam: function(name) { /*?videoId=identification */ var params = ...
- js通过location.search来获取页面传来的参数
这篇文章主要介绍了通过window.location.search来获取页面传来的参数,经测试是OK的 ? 1 2 3 4 5 function GetQueryString(name) { var ...
- CI框架获取post和get参数 CodeIgniter
请参考:CI文档的输入类部分: $this->input->post() $this->input->get() ------------------------------- ...
- vue中如何不通过路由直接获取url中的参数
前言:为什么要不通过路由直接获取url中的参数? vue中使用路由的方式设置url参数,但是这种方式必须要在路径中附带参数,而且这个参数是需要在vue的路由中提前设置好的. 相对来说,在某些情况下直接 ...
- 使用jquery获取url及url参数的方法及定义JQuery扩展方法
1.jquery获取url很简单,代码如下: window.location.href; 其实只是用到了javascript的基础的window对象,并没有用jquery的知识. 2.jquery获取 ...
随机推荐
- mysql常用表/视图管理语句
查看所有表 show tables; 查看表/视图结构 desc 表名/视图名: 查看建表过程 show create table 表名: 查看建视图过程 show create view 视图名 ...
- windows 远程桌面命令 mstsc
win+R------>mstsc: 弹出: 目标机必开远程
- Win7 DCOM 配置中我的电脑出现红色箭头并且无属性显示的解决方法
http://blog.csdn.net/embededvc/article/details/19234479
- Pyqt QDockWidget 停靠窗体
网上的一个关于QDockWidget 停靠窗体的教程 代码: # -*- coding: utf-8 -*- from PyQt4.QtGui import * from PyQt4.QtCore i ...
- Pyqt 时时CPU使用情况
借鉴代码来自:https://github.com/hgoldfish/quickpanel 实现代码: # -*- coding:utf-8 -*- from __future__ import p ...
- Introduction to replication 翻译
翻译自用,还有很多谬误之处,敬请甄别,转载请注明出处 Introduction to replication (replication介绍) Replication is one of the m ...
- Linux發送郵件
1.直接使用shell當編輯器 [root@phburdb1 mail]# mail -s "Hello World" juncai.chen@innolux.comHello j ...
- hdu 4039 2011成都赛区网络赛I ***
两层搜索,直接for循环就行了,还要注意不能是自己的朋友 #include<cstdio> #include<iostream> #include<algorithm&g ...
- loj 1426(dfs + bfs)
题目链接:http://lightoj.com/volume_showproblem.php?problem=1426 思路:首先我们预处理出每一个"*"在某一方向上最终能到达的位 ...
- 全面解析windows下Memcache技术应用
原文 http://www.cnblogs.com/liuqin520/p/4615644.html 一.Memcache介绍 Memcache 是 danga.com 的一个项目,最早是为 L ...