Fetch is a new API that makes ‘Fetch’ing remote resources much easier. Like XMLHttpRequest, Fetch can be used for making requests same origin or cross domain requests. Fetch uses a cleaner, more powerful API that separates the request from the response and uses a promise to return the response.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[[["Fetch API simplifies fetching remote resources, offering a more streamlined approach than XMLHttpRequest."],["It supports both same-origin and cross-domain requests for versatile resource retrieval."],["Fetch API provides a clear separation between request and response for enhanced code organization."],["It leverages promises for efficient asynchronous handling of responses, improving code readability and performance."]]],["Fetch API simplifies fetching remote resources, handling both same-origin and cross-domain requests. It offers a refined interface compared to XMLHttpRequest, distinguishing the request from the response. Crucially, Fetch utilizes promises to deliver the response, providing a more structured and efficient method for managing asynchronous operations. Its improved design aims to streamline the process of data retrieval from remote sources.\n"]]