Send asynchronous browser requests with fetch, XMLHttpRequest, JSON, errors, and progressive UI.
Lessons
Set method, body, mode, cache, and credentials.
fetch Options & Config is easiest to learn by reading the example, changing it, and observing the result.
const response = await fetch('/api/lessons', {
method: 'GET',
headers: { 'Accept': 'application/json' },
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
redirect: 'follow'
});Practice the fetch Options & Config example in a small scratch file, then explain what changed and why.