← 返回教程列表
🔄 AJAX 教程
POST 请求
fetch("/api/login", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username: "admin", password: "123456" })
})
.then(res => res.json())
.then(data => console.log(data));