Capstone: practice all four methods with async/await, response.ok checks, and JSON bodies. Writes are fake-persisted by JSONPlaceholder (echoes look real). Needs network access.

Idle

Action results appear here.

Load the list, then create / update / delete.

Important JavaScript

async function apiJson(url, options) {
  const response = await fetch(url, options);
  if (!response.ok) {
    throw new Error("HTTP " + response.status);
  }
  if (options && options.method === "DELETE") {
    return null;
  }
  return response.json();
}