打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模块:HttpTest:修订间差异

来自夜幕之下
Rin留言 | 贡献
创建页面,内容为“local p = {} function p.test() local url = "https://data.saltedkiss.org/items/cards?limit=1" local res = mw.http.fetch(url) if not res then return "HTTP请求失败" end return "状态码: " .. tostring(res.status) .. "<br>内容:<pre>" .. mw.text.nowiki(res.body) .. "</pre>" end return p”
 
Rin留言 | 贡献
无编辑摘要
第2行: 第2行:


function p.test()
function p.test()
 
     return "mw.http = " .. tostring(mw.http)
     local url = "https://data.saltedkiss.org/items/cards?limit=1"
 
    local res = mw.http.fetch(url)
 
    if not res then
        return "HTTP请求失败"
    end
 
    return "状态码: " .. tostring(res.status) ..
          "<br>内容:<pre>" .. mw.text.nowiki(res.body) .. "</pre>"
 
end
end


return p
return p

2026年3月11日 (三) 21:52的版本

此模块的文档可以在模块:HttpTest/doc创建

local p = {}

function p.test()
    return "mw.http = " .. tostring(mw.http)
end

return p