cURL / Mailing Lists / curl-library / Single Mail

curl-library

New project LuaCURL v1.0 binding CURL 7.14.0 to Lua 5.x is up

From: Alexander Marinov <alek_at_crazyland.com>
Date: Mon, 27 Jun 2005 12:06:52 -0700 (PDT)

LuaCURL is CURL 7.14.0 binding to Lua 5.x
Home Page: http://luacurl.luaforge.net
Download: http://luaforge.net/projects/luacurl/

Here is an example how it works:

require("luacurl")

c=curl.new()

c:setopt(curl.OPT_WRITEFUNCTION, function (stream, buffer)
        if stream:write(buffer) then
                return string.len(buffer);
        end
end);

c:setopt(curl.OPT_WRITEDATA, io.open("lua-5.0.2.tar.gz", "wb"));

c:setopt(curl.OPT_PROGRESSFUNCTION, function (_, dltotal, dlnow, uptotal,
 upnow)
        print(dltotal, dlnow, uptotal, upnow);
end);

c:setopt(curl.OPT_NOPROGRESS, false);

c:setopt(curl.OPT_HTTPHEADER, "Connection: Keep-Alive", "Accept-Language:
 en-us");

c:setopt(curl.OPT_URL, "http://www.lua.org/ftp/lua-5.0.2.tar.gz");
c:setopt(curl.OPT_CONNECTTIMEOUT, 15);
c:perform();
c:close();

Please send me feedback with suggestions how to improve it, bug reports
etc.

Best Regards,
alek

_____________________________________________________________
Get your free email at http://www.crazyland.com
Received on 2005-06-27