Send asynchronous browser requests with fetch, XMLHttpRequest, JSON, errors, and progressive UI.
Lessons
Read non-JSON response bodies.
Text, Blob & FormData Responses is easiest to learn by reading the example, changing it, and observing the result.
const response = await fetch('/data/feed.xml');
const text = await response.text(); // raw string
const doc = new DOMParser().parseFromString(text, 'application/xml');
console.log(doc.querySelector('title').textContent);
// Other body readers:
// await response.blob(); // binary (images, files)
// await response.formData(); // multipart form dataPractice the Text, Blob & FormData Responses example in a small scratch file, then explain what changed and why.