mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +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:
@@ -31,7 +31,7 @@ extern "C" {
|
||||
#include "luainstance_helpers.h"
|
||||
|
||||
#define LUA_API_VERSION_MAJOR 1
|
||||
#define LUA_API_VERSION_MINOR 23
|
||||
#define LUA_API_VERSION_MINOR 24
|
||||
|
||||
/* inspired by Steve Kemp http://www.steve.org.uk/ */
|
||||
class CLuaInstance
|
||||
|
Reference in New Issue
Block a user