Make network requests to servers using the modern, promise-based Fetch API.
The Fetch API provides a modern, powerful, and flexible interface for fetching resources across the network. It's a significant improvement over the older `XMLHttpRequest` object. The `fetch()` method is the main entry point. It takes the URL of the resource you want to fetch as an argument and returns a `Promise` that resolves to the `Response` object representing the response to your request. This promise-based nature allows for clean chaining with `.then()` or usage with `async/await`. The `Response` object doesn't directly contain the JSON or text body of the response. Instead, it's a stream, and you need to call a method like `.json()` to parse the body as JSON, or `.text()` to get it as plain text. These methods themselves return promises, so they need to be chained or awaited as well. `fetch()` can also be used to make other types of requests, like POST, PUT, or DELETE. To do this, you pass a second argument to `fetch()`: an `options` object where you can specify the `method`, `headers` (like `'Content-Type': 'application/json'`), and the `body` of the request, which you typically stringify using `JSON.stringify()`.