访问请求体

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 @ 2020-02-27 21:57  FromScratch  阅读(156)  评论(0编辑  收藏  举报