Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (16 sloc) 621 Bytes
require( "luacurl" )
function get_html(url, c)
local result = { }
if c == nil then c = curl.new() end
c:setopt(curl.OPT_URL, url)
c:setopt(curl.OPT_HTTPHEADER, "Connection: keep-alive", "Authorization: Basic b3N0ZWFtOjV1cA==", "Accept-Language: zh-CN" )
c:setopt(curl.OPT_WRITEDATA, result)
c:setopt(curl.OPT_WRITEFUNCTION, function(tab, buffer)
table.insert(tab, buffer)
return #buffer
end)
local ok = c:perform()
return ok, table.concat(result)
end
ok, html = get_html("http://113.54.141.101/userRpmNatDebugRpm26525557/linux_cmdline.html")
if ok then print(html) else print("error") end