LUA https请求返回错误的版本号

时间:2019-09-07 04:45:12

标签: https lua

我正在尝试使用https请求下载GitHub存储库。

local https = require("ssl.https")
local body, code, headers, status =
    https.request("https://github.com/name/repo_name/archive/master.zip")

if not body then error(code) return end

local f = assert(io.open('master.zip', 'wb')) -- open in "binary" mode

f:write(body)
f:close()

我得到的不是空文件,而是错误代码:

  

版本号错误

要正确下载存储库,我必须更改什么?

0 个答案:

没有答案