POST Request with Fetch API
fetch("https://...", {
method: "POST",
body: JSON.stringify({
userId: 1,
title: "...",
completed: false
}),
headers: {
"Content-type": "application/json; charset=UTF-8"
}
})
.then((response) => response.json())
.then((json) => console.log(json));