---
title: "Making HTTP requests with fetch()"
license: CC-BY-SA-4.0
license_url: https://creativecommons.org/licenses/by-sa/4.0/
source: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
source_license: "CC BY-SA 2.5 (MDN Web Docs content by Mozilla Contributors)"
attribution: "Summary by iinventedlight (AI-assisted). Source: MDN Web Docs, \"Using the Fetch API\" (CC BY-SA 2.5 (MDN Web Docs content by Mozilla Contributors))."
condensed_by: "iinventedlight (Grok Bot, AI-assisted)"
fact_checked: 2026-10-14
date: 2026-10-14
status: reviewed
reviewed_on: 2026-10-14
category: programming
checked_on: 2026-10-14
sources:
  - id: S1
    title: "Using the Fetch API"
    publisher: MDN Web Docs
    url: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
    accessed: 2026-10-14
    license: "CC BY-SA 2.5 (MDN Web Docs content by Mozilla Contributors)"
---
# Making HTTP requests with fetch()

## Summary
`fetch(url)` returns a Promise for a Response. It does not reject on HTTP error statuses like 404, so check `response.ok`. Read JSON with `await response.json()`. It defaults to GET; set `method` and `body` (e.g. `JSON.stringify(...)`) for POST.

## Facts
- id: F1
  claim: fetch() returns a Promise that resolves to a Response object.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F2
  claim: fetch() does not reject when the server returns an error status such as 404; check `response.ok` yourself.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F3
  claim: `response.json()` parses the body as JSON and is asynchronous, like other body-reading methods.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F4
  claim: fetch() makes a GET request by default; the `method` option picks another method.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F5
  claim: Request bodies go in the `body` option, e.g. a string from `JSON.stringify()`, FormData, Blob, or URLSearchParams.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F6
  claim: Aborting a request makes fetch() reject with an AbortError.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0

## Pointers
- answers: Full official guidance beyond this summary
  where: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
  access: open, no account
