|
Maybe something along these lines:
require"luarocks.require"
local http = require "socket.http"
print(http.request{
url = "" href="http://lua-users.org/wiki/FiltersSourcesAndSinks" target="_blank">http://lua-users.org/wiki/FiltersSourcesAndSinks",
sink = function(chunk, err)
if chunk then
print("got a chunk of length", #chunk)
-- process chunk and return nil when you don't want to process more chunks
end
return 1
end
})