http-status-codes - 不包含响应体的 HTTP 状态代码的完整列表

标签 http-status-codes

开始喜欢HTTP,直到发现一些状态码like 304 , 不包含消息体并由 CRLF 终止。

哪里有完整的 list ?到目前为止,我得到了:100-199 , 204 , 和 304 .还有其他人吗?

编辑 : 不,根据标准,没有其他人。谢谢你的回答。

我关心用持久连接分隔消息。即一个 HTTP 消息在哪里停止,下一个开始。

最佳答案

所有 4xx 的主体都是可选的错误代码:

Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition.



5xx 相同:

Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation...



(应该意味着真的,他们应该,但这不是必须的。)
1xx据我所知,消息不包含正文。 201 (除了 204205 )不必有 body 。 3xx是一个混合包,但对很多人来说, body 是可选的。

来源:HTTP/1.1: Status Code definitions .

消息长度信息的规则在 HTTP Message - 4.4 Message Length 中描述.这不是微不足道的。

关于http-status-codes - 不包含响应体的 HTTP 状态代码的完整列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8628725/

相关文章:

java - 在 Spring Boot 中返回状态码为 202 的 HTTP 响应

javascript - jQuery.ajax *仅*检索状态代码但不检索/下载整个文档?

Ajax 调用被浏览器取消

asp.net-mvc - HttpStatusCodeResult 消息编码

javascript - OPTIONS 请求应该返回 429 吗?

http - CORS 预检请求的正确状态代码是什么?

java - 返回哪个 HTTP 响应状态

jquery - jQuery AJAX XMLHTTPRequest在错误状态下没有有用的信息

asp.net - 在API方法中返回HttpStatusCode

http - 连同 404 错误一起发送其他内容有什么问题吗?