Modern Application Development II, Quiz 2
Suppose a client wants to make a POST request using the Fetch API to a public endpoint at /api/submit, which includes sending a data object as JSON in the request body.
const data = { name: "Aditya", score: 95,};
fetch("/api/submit", { method: "POST", headers: { // CODE }, body: JSON.stringify(data),});Which headers are necessary for this request to succeed, (inside CODE)?
Suppose a client wants to make a **POST** request using the Fetch API to a public endpoint at `/api/submit`, which includes sending a **data** object as JSON in the request body. const data = { name: "Aditya", score: 95, }; fetch("/api/submit", { method: "POST", headers: { // CODE }, body: JSON.stringify(data), }); Which headers are **necessary** for this request to succeed, (inside **CODE**)? Which of the following statements are true? Which of the following statement(s) about Web Storage APIs is/are correct?