why was HTTP status code 102 removed from HTTP/1.1

血红的双手。 提交于 2021-01-28 18:00:30

问题


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.

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?

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?


回答1:


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

9.1 Informational 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. 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.

(Emphasis mine.)

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

It even says so in RFC 2616:

10.1 Informational 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.

So where did 102 come from?

It's from RFC 2518 (WEBDAV):

10 Status Code Extensions to HTTP/1.1

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

10.1 102 Processing

[...]




回答2:


As @melpomene has stated, the HTTP status code 102 has never been part of the official HTTP specification. It belongs to the "HTTP Extensions" documents produced by the WebDAV working group.

It appears for first time in "HTTP Extensions for Web Distributed Authoring and Versioning – WebDAV" RFC 2518, issued February 1999.

That document is superseded for "HTTP Extensions for Distributed Authoring – WebDAV" RFC 4918, issued June 2007. There is removed:

Note: the HTTP status code 102 (Processing) has been removed in this specification; its IANA registration should continue to reference RFC 2518.

And the reason was lack of implementation:

The definitions of HTTP status code 102 ([RFC2518], Section 10.1) and the Status-URI response header (Section 9.7) have been removed due to lack of implementation.




回答3:


It was not "removed". It is part of the registered HTTP status codes, see https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml. Note that no single RFC defines "all" status codes. Also note that, in general, status codes apply to all versions of HTTP.



来源:https://stackoverflow.com/questions/53238328/why-was-http-status-code-102-removed-from-http-1-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!