03.05.2023, 11:13
Use this to get raw POST JSON in your .lp file:
Code:
<?
require('apps')
-- read POST data
body = ngx.req.get_body_data()
if body then
-- decode data as JSON
data = json.pdecode(body)
-- check that data is a table
if type(data) == 'table' then
log(data)
-- add data to CSV
end
end