404 header - HTTP 1.0 or 1.1?

前端 未结 6 1636
心在旅途
心在旅途 2020-11-30 07:54

Why does almost every example I can find (including this question from about a year ago) say that a 404 header should be HTTP/1.0 404 Not Found when we\'ve real

6条回答
  •  死守一世寂寞
    2020-11-30 08:08

    It does not matter all that much. The client is responsible for telling the server which version of HTTP it uses. Then, the server is supposed to answer with the same version. This does not always happen; I just got this response from a server:

    $ telnet example.com 80
    Trying 123.123.123.123...
    Connected to example.com.
    Escape character is '^]'.
    GET /fork HTTP/1.0
    
    HTTP/1.1 404 Not Found
    Content-Length: 1635
    Content-Type: text/html
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    Date: Tue, 04 May 2010 22:30:36 GMT
    Connection: close
    

    I asked the server to use HTTP 1.0, but it went ahead and responded with HTTP 1.1.

提交回复
热议问题