download_callback.lua

#!/usr/bin/env eco

local http = require 'eco.http.client'

local resp, err = http.get('http://127.0.0.1:8080/test', {
    body_to_file = function(data)
        io.write(data)
    end
})

if not resp then
    print(err)
    return
end

print('code:', resp.code)
print('status:', resp.status)
generated by LDoc 1.5.0 Last updated 2026-08-06 11:36:12