为什么从HTTP/1.1中删除了HTTP状态代码102 [英] why was HTTP status code 102 removed from HTTP/1.1

查看:65
本文介绍了为什么从HTTP/1.1中删除了HTTP状态代码102的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为可能需要很长时间才能完成的REST服务返回状态102似乎有时是个好主意.一个更好的主意通常是返回一个带有请求状态的URL的接受的202,该请求在准备就绪时将具有最终答案.

returning status 102 for a REST service that might takes a long time to complete seems like it might sometimes be a good idea. A better idea is often to return a 202 accepted with a reference to URLs with the status of the request and which will have the final answer when its ready.

我从 https://evertpot.com/http/102-processing 注意到,状态代码102不在HTTP/1.1规范中( rfc2616 ).为什么将其删除?

I note from https://evertpot.com/http/102-processing that status code 102 is not in the HTTP/1.1 spec (rfc2616). Why was it removed?

鉴于这就是为什么许多人仍在使用和推荐它的原因?是因为大多数服务都必须支持HTTP/1.0才能实现向后兼容,所以仍然有可能实现它?

And given that it has been why are many people still using and recommending it? Is it because most services must support HTTP/1.0 for backwards compatibility and therefore it is likely to be implemented anyway?

推荐答案

根据 RFC 1945 (HTTP/1.0),第9.1节:

According to RFC 1945 (HTTP/1.0), section 9.1:

9.1信息性1xx

此类状态码表示临时响应,仅由状态行和可选标头组成,并且为由空行终止. HTTP/1.0未定义任何1xx状态代码,并且它们不是对HTTP/1.0请求的有效响应.但是,它们对于实验应用可能有用超出了本规范的范围.

This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. HTTP/1.0 does not define any 1xx status codes and they are not a valid response to a HTTP/1.0 request. However, they may be useful for experimental applications which are outside the scope of this specification.

(强调我的.)

所以不是HTTP/1.1删除了102;而是增加了100和101.

So it's not that HTTP/1.1 removed 102; rather it added 100 and 101.

在RFC 2616中也是如此:

10.1信息性1xx

此类状态码表示临时响应,仅由状态行和可选标头组成,并且为由空行终止.没有为此所需的标题状态码类别.由于HTTP/1.0未定义任何1xx状态代码,服务器不得向HTTP/1.0客户端发送1xx响应除了在实验条件下.

This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. There are no required headers for this class of status code. Since HTTP/1.0 did not define any 1xx status codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client except under experimental conditions.

那么102是哪里人呢?

So where did 102 come from?

它来自 RFC 2518 (WEBDAV):

It's from RFC 2518 (WEBDAV):

HTTP/1.1的10个状态代码扩展

以下状态代码已添加到HTTP/1.1中定义的状态代码中[ RFC2068 ].

The following status codes are added to those defined in HTTP/1.1 [RFC2068].

10.1 102处理

[...]

这篇关于为什么从HTTP/1.1中删除了HTTP状态代码102的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆