Javascript Fetch 不能与 Edge 上的 URLsearchparams 一起使用
Javascript Fetch does not work with URLsearchparams on Edge
有人可以向我解释为什么这段代码没有在 Edge 上产生 http 请求吗?
https://jsfiddle.net/sectioni/tyr5fLgc/1/
let url = "/test.aspx";
// don't change this to a const because the append will not work in Edge
let data = new URLSearchParams();
data.append("userPreferences", "bla");
let promise = fetch(url, {
method: "POST", // POST, PUT, DELETE, etc.
body: data,
cache: "no-cache", // no-store, reload, no-cache, force-cache, or only-if-cached
keepalive: true
});
它确实适用于 Chrome 和 Firefox,如果您删除正文部分,请求将在 Edge 上发送。
看来,由于 Edge 已切换到使用 Chromium,因此现在可以直接下载 Edge 以对其进行更新。
使用 Edge 81 测试后,问题不再出现。这会使它成为旧版 Edge 的错误。
有人可以向我解释为什么这段代码没有在 Edge 上产生 http 请求吗? https://jsfiddle.net/sectioni/tyr5fLgc/1/
let url = "/test.aspx";
// don't change this to a const because the append will not work in Edge
let data = new URLSearchParams();
data.append("userPreferences", "bla");
let promise = fetch(url, {
method: "POST", // POST, PUT, DELETE, etc.
body: data,
cache: "no-cache", // no-store, reload, no-cache, force-cache, or only-if-cached
keepalive: true
});
它确实适用于 Chrome 和 Firefox,如果您删除正文部分,请求将在 Edge 上发送。
看来,由于 Edge 已切换到使用 Chromium,因此现在可以直接下载 Edge 以对其进行更新。
使用 Edge 81 测试后,问题不再出现。这会使它成为旧版 Edge 的错误。