Http2协议和状态消息

编程入门 行业动态 更新时间:2024-10-23 05:52:55
本文介绍了Http2协议和状态消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

因此,我只是很难理解http2协议不支持旧的http1.1协议中的404 Not Found 之类的http状态消息. 我们的网络Api之一正在使用http状态消息向终端用户返回可读消息.

So i just found out the hard way that the http2 protocol does not support http status messages like 404 Not Found in the old http1.1 protocol. One of our web Api's is using the http status message to return a readable message to the end user.

现在我的问题是,是否有一种新的方法可以在http2中返回状态消息,还是必须在http响应正文中返回该消息?

Now my question is, is there a new way of returning status messages in http2 or do we have to return the message in the http response body?

推荐答案

没有新的标准方法,因此,自定义响应标头或消息正文是您唯一的选择.

There is no new standard way, thus either a custom response header or the message body are your only choices.

(记录:我反对这一变更)

(For the record: I argued against this change)

更多推荐

Http2协议和状态消息

本文发布于:2023-11-01 20:08:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550286.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:状态   协议   消息

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!