Capture full response in Lua Socket call
snippet in lua

Capture full response in Lua Socket call

user6544

local ltn12 = require 'ltn12'

-- ...

local res = {}
r, c, h, s = http_socket.request
{
  method = "GET",               -- Validation API Method
  url = "http://google.com",    -- Validation API URL
  headers = header,
  sink = ltn12.sink.table(res)
}

res = table.concat(res)
print(res)