Search code examples
httphttp-status-codes

Why is there a HTTP status message when there already is a HTTP status code?


An HTTP response may look like:

HTTP/1.1 200 OK

I think 200 is already tell client that it is OK, and OK in response can be omitted. So what is the approach that is existed?


Solution

  • From https://greenbytes.de/tech/webdav/rfc7230.html#rfc.section.3.1.2:

    The reason-phrase element exists for the sole purpose of providing a textual description associated with the numeric status code, mostly out of deference to earlier Internet application protocols that were more frequently used with interactive text clients. A client SHOULD ignore the reason-phrase content.