I'm writing a HTTP client, and wondering if HTTP responses are required to have any headers?
So is the following a valid HTTP response? (where \r\n
== CRLF). How should a client handle it?
HTTP/1.1 200 OK\r\n
\r\n
The related questions Http response with no http header and What HTTP response headers are required are similar, but I think they are subtly-but-crucially different. They are both from the point of view of a server generating headers, rather than a parser parsing a response.
For example, a detailed answer to the current question could include how the client should interpret the above minimal response: whether it should accept the 200 response or abort, and what it should do with the underlying connection in terms of keeping it open or closing it.