Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dl(sUrl)
- -- Check if the URL is valid
- local ok, err = http.checkURL(sUrl)
- -- print("Downloading "..sUrl.." into "..file)
- if not ok then
- printError(err or "Invalid URL.")
- return false
- end
- local response = http.get(sUrl , { ["Cache-Control"] = "no-cache" } , true)
- if not response then
- printError("Download failed.")
- return false
- end
- local sResponse = response.readAll()
- response.close()
- return sResponse
- end
- print dl('https://www.random.org/integers/?num=1&min=1000000&max=9999999&col=1&base=10&format=plain&rnd=new')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement