访问请求体

content_by_lua_block {
ngx.req.read_body() -- explicitly read the req body
local data = ngx.req.get_body_data()
if data then
ngx.say("body data:")
ngx.print(data)
return
end

-- body may get buffered in a temp file:
local file = ngx.req.get_body_file()
 if file then
ngx.say("body is in file ", file)
else
ngx.say("no body found")
end
}
posted @   FromScratch  阅读(156)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示