Fetch and HTTP

This topic is about the network round trip itself. Awaiting a response, distinguishing a failed request from an unsuccessful status, sending a JSON body with the right headers, timing out or cancelling an in-flight call, retrying without duplicating a side effect, and typing an unknown payload all belong here. Examples show the exact call sequence and state which assumption the server must satisfy, including CORS and content-type expectations. Browse the task groups to compare reading a response with writing one, then use the relationship links to reach transformation examples that run after the bytes arrive. Each page also names the failure modes that a bare then chain tends to hide from you during debugging.

In scope: Include examples centred on the request lifecycle: headers, bodies, status handling, timeouts, and aborts. Out of scope: Exclude pure response-shaping code that never touches the request lifecycle.

6 published examples across 2 primary task groups. Read the group heading to find the task you are solving, then pick the Example whose assumptions match your page.

Fetch API data

3 examples

Send a request, await the response, and handle status, timeout, and cancellation behaviour.

Transform data

3 examples

Reshape collections and records in memory into the structure the next step needs.

Adjacent navigation