Pass an options object to configure the request method, headers, and body.
const response = await fetch("/api/users", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ name: "Alice" })
});
Default method is GET. POST, PUT, DELETE require explicit setting.