fetch("https://codetogo.io/api/users.json", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
key1: "value1"
})
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(console.error);
[{ id: 1, name: "Sam" }, { id: 2, name: "Alex" }]