最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error "net::ERR_H2_OR_QUIC_REQUIRED" with Fetch API - Stack Overflow

programmeradmin0浏览0评论

I want to modify the url of the Request object, but I have some problems.

const r = () =>
  new Request("post", {
    method: "post",
    body: JSON.stringify({ name: "none" }),
  });

fetch(r()); // ok

fetch(new Request("post", r())); // net::ERR_H2_OR_QUIC_REQUIRED

On a server that does not support http2, the second request will fail.

On a server that supports http2, both requests succeed and the server receives the request body. However, in the Chrome network panel, the payload of the second request cannot be viewed.

The first request has the Payload panel:

But the second does not:

So what's the difference between these two request? How can I make second request work on the serve that does not support http2? How can I have payload panel on chrome devtools?

发布评论

评论列表(0)

  1. 暂无评论