Files
resty_functions/test_scripts/test_upt.lua
T

11 lines
371 B
Lua
Raw Normal View History

2022-08-23 23:48:00 +08:00
-- retrieve the content of a URL
local http = require("socket.http")
local body, code = http.request("https://upyun.alchemy-studio.cn/music-room/17c832cb-bc6b-41f7-96cd-190b7fe4a3d7.jpeg?_upt=e487088a1661273055")
if not body then error(code) end
-- save the content to a file
local f = assert(io.open('test.jpg', 'wb')) -- open in "binary" mode
f:write(body)
f:close()