A complete list of HTTP status codes that DO NOT include a RESPONSIBILITY TELEPHONE

I started to like HTTP until I found that some like 304 status codes did not contain a message body and ended with CRLF.

Where is the full list? So far I have received: 100-199 , 204 and 304 . Are there any others?

EDIT : No, there are no others, according to the standard. Thanks for the answer.

I am concerned about sharing messages with persistent connections. that is, where one HTTP message stops and the next begins.

+13
source share
1 answer

The body is optional for all 4xx error codes:

Unless it responds to a HEAD request, the server SHOULD include an object containing an explanation of the error situation, and whether this is a temporary or permanent condition.

Same for 5xx :

Unless it responds to a HEAD request, the server SHOULD include an object containing an explanation of the error situation ...

(SHOULD mean that indeed, they should, but that DO NOT.)

Messages 1xx do not contain a body, as far as I can tell. 201 (in addition to 204 and 205 ) does not need to have a body. 3xx are a mixed bag, but the body is optional for many of them.

Source: HTTP / 1.1: Status Code Definitions .

Rules for message length information are described in HTTP Message - 4.4 Message Length . This is not entirely trivial.

+18
source

All Articles