Fetch API & Handling JSON Responses
Which request option affects how the browser handles CORS?
fetch('/api/data', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Custom-Header': 'value'
},
body: JSON.stringify(data),
mode: 'cors',
cache: 'no-cache',
redirect: 'follow'
})