You can use ltn12.sink.table to collect the results in a given table in parts. Then you can use table.concat to get the resulting row.
An example of using the ltn12.sink documentation:
-- load needed modules local http = require("socket.http") local ltn12 = require("ltn12") -- a simplified http.get function function http.get(u) local t = {} local status, code, headers = http.request{ url = u, sink = ltn12.sink.table(t) } return table.concat(t), headers, code end
source share