fetch()
Modern JS API for HTTP calls — the replacement for old XMLHttpRequest.
const r = await fetch('/api/users'); const data = await r.json();. Promise-based, cleaner than XHR. Built into all modern browsers and Node.js since 2022.
Modern JS API for HTTP calls — the replacement for old XMLHttpRequest.
const r = await fetch('/api/users'); const data = await r.json();. Promise-based, cleaner than XHR. Built into all modern browsers and Node.js since 2022.