Skip to content

Instantly share code, notes, and snippets.

View BigKuCha's full-sized avatar
🥇
上马杀敌,下马念经。心中有佛,手里有刀

大裤衩子 BigKuCha

🥇
上马杀敌,下马念经。心中有佛,手里有刀
View GitHub Profile
@RavenZZ
RavenZZ / combine.lua
Last active February 4, 2022 07:30
combine two request by openresty
cjson = require "cjson"
ngx. req. read_body() -- explicitly read the req body
local data = ngx. req. get_body_data()
local jsonBody = cjson. decode(data);
if data then
local reqs = { }
--ngx. say("body data:")
for key, value in pairs(jsonBody) do
--ngx.print(key)
local redis_c = require "resty.redis"
local ok, new_tab = pcall(require, "table.new")
if not ok or type(new_tab) ~= "function" then
new_tab = function (narr, nrec) return {} end
end
local _M = new_tab(0, 155)