Skip to content

Instantly share code, notes, and snippets.

View Randyx233's full-sized avatar
🤣
Focusing

Randyx Randyx233

🤣
Focusing
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)