Back to search

API and network basics in JavaScript: fetch, XMLHttpRequest, HTTP methods, JSON responses, and error handling in API calls

Frontend and Node.js code often call APIs using `fetch` today, but interviews still expect you to know HTTP basics and sometimes older XHR patterns.

JavaScript Medium Theory

API and network basics in JavaScript: fetch, XMLHttpRequest, HTTP methods, JSON responses, and error handling in API calls

Frontend and Node.js code often call APIs using `fetch` today, but interviews still expect you to know HTTP basics and sometimes older XHR patterns.

  • Know common HTTP methods
  • `fetch` returns a promise
  • HTTP errors and network failures are not the same thing

API and network basics in JavaScript: fetch, XMLHttpRequest, HTTP methods, JSON responses, and error handling in API calls