Commit Graph

4 Commits

Author SHA1 Message Date
GetAway
2a219b342e fix for newer libcurl 2023-01-12 21:08:40 +01:00
M. Liebmann
9feb8efd23 CLuaInstCurl: Add script functions
- encodeUri
 - decodeUri
 - setUriData
 - Set Lua api version to 1.78
2017-10-23 07:54:19 +02:00
M. Liebmann
c5bcbf490c CLuaInstCurl::CurlDownload: Rework progress display
- Set Lua api version to 1.31
2015-12-15 00:34:13 +01:00
M. Liebmann
4f9158c2a9 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
2015-12-13 23:36:52 +01:00