if "GET" == request_method then
args = ngx.req.get_uri_args()
elseif "POST" == request_method then
ngx.req.read_body()
args = ngx.req.get_post_args()
end
是否有像上述代码这样的方法,获取PUT参数值,万分感谢
if "GET" == request_method then
args = ngx.req.get_uri_args()
elseif "POST" == request_method then
ngx.req.read_body()
args = ngx.req.get_post_args()
end
是否有像上述代码这样的方法,获取PUT参数值,万分感谢
lua_need_request_body on;
location = /test {
content_by_lua '
ngx.say("hello"..ngx.var.request_method)
data = ngx.req.get_post_args()
ngx.say(data.nihao)
';
}
PUT
你就按照POST
的方式来处理就好了