Fetch 是一种新的 API,大大简化了“Fetch”远程资源。与 XMLHttpRequest 一样,Fetch 可用于发出相同的请求或跨网域请求。Fetch 使用的是更简洁、更强大的 API,可将请求与响应分离,并使用 promise 返回响应。
Fetch API 简介
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],["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"],null,[]]