mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 18:31:22 +02:00
CLuaInstance: Add class for using libcurl
- Add simple download function - Set Lua api version to 1.24 parameter typ default ---------------------------------------- url string required o, outputfile string when empty then save to string as secund return value A, userAgent string empty v, verbose bool false s, silent bool false connectTimeout number 20 ipv4 bool false ipv6 bool false useProxy bool true (default) followRedir bool true maxRedirs number 20 Example: -- simplest program call: -- ---------------------- local curl = curl.new() local ret, data = curl:download{url="http://example.com", o="/tmp/test.txt"} if ret ~= CURL.OK then print("Error: " .. data) end -- or -- local curl = curl.new() local ret, data = curl:download{url="http://example.com"} if ret == CURL.OK then -- downloaded data print(data) .. else print("Error: " .. data) end
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#define LUA_CLASSNAME "neutrino"
|
||||
#define LUA_VIDEO_CLASSNAME "video"
|
||||
#define LUA_MISC_CLASSNAME "misc"
|
||||
#define LUA_CURL_CLASSNAME "curl"
|
||||
|
||||
//#define LUA_WIKI "http://wiki.tuxbox.org/....."
|
||||
#define LUA_WIKI "https://slknet.de/wiki/w"
|
||||
|
Reference in New Issue
Block a user