How to send AND receive POST requests with JavaScript HTML [closed]

Solution
fetch("http://localhost:5000/newCheckout", {
  method: "POST", 
  body: JSON.stringify(data),
  headers: {
    'Content-Type': 'application/json'
  }
}).then(res => {
  console.log("Request complete! response:", res);
});