在Golang发送HTTP2请求时,如何指定流优先级?

发布于 2025-02-08 18:55:57 字数 495 浏览 1 评论 0原文

对于下面的客户端示例,在调用“ client.get()”之前,没有选项可以提供流优先级?

我们有任何指定流优先级的选择吗?

client := http.Client{

        Transport: &http2.Transport{

            DialTLS: func(network, addr string, cfg *tls.Config) (net.Conn, error) {

                return net.DialTimeout(network, addr, time.Second)

            },

                AllowHTTP: true,

        },

    }


// can I specify http2 stream priority before calling Get() below ??

    resp, err := client.Get(path)

For the client example below, before calling "client.Get()", there is no option to provide the stream priority ?

Do we have any option to specify stream priority ?

client := http.Client{

        Transport: &http2.Transport{

            DialTLS: func(network, addr string, cfg *tls.Config) (net.Conn, error) {

                return net.DialTimeout(network, addr, time.Second)

            },

                AllowHTTP: true,

        },

    }


// can I specify http2 stream priority before calling Get() below ??

    resp, err := client.Get(path)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文