Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Voices That Matter

Web Design Reference Guide

Hosted by

Server Response

Last updated Oct 17, 2003.

After the headers have been sent, the client sends a blank line, also known as a CRLF, and has the option of sending entity content. CRLF stands for Carriage Return and Line Feed. Some computers used CR while others used LF. It's also known as newline especially by developers, and it indicates the end of a line.

Most requests don't have entity content. When completing a form, the form's content is sent to the server as a part of the entity body. The server can take a break because it's the client's turn to respond with its first line consisting of three parts: HTTP version number, status code, and a description of the status code. For example:

HTTP/1.1 200 OK

The HTTP specification explains the meaning of each status code. 200 means that everything is OK. Anything with the 2xx code means the response was successful. 3xx means the URL requested was redirected. 4xx is a client error, as we know 404 too well. This error appears when the user requests something and can't access it because it was not a good URL (404) or doesn't have authorization (401). 5xx are errors that occur on the server and there is nothing the user can do except notify the webmaster. For the 5xx, we most often see 500, which is internal server error. It can happen for many reasons.

The server sends headers that might include the file type being sent, the last date modified, and length of the file. Again, a header is followed by a single blank line. After all this communication, the server sends what the client requested in the first place: the content, which can be an HTML file, an image, or whatever is available on a Web server. The server closes the connection after sending the requested data.

That's an insight into the world of how clients and servers communicate with each other through HTTP. You may have seen references to HTTP 1.0 and HTTP 1.1. 1.1 is an improvement because it has persistent connections as opposed to 1.0's individual requests. For example, an HTML page with four images requires four connections using HTTP 1.0, with each one sending an image. 1.1, on the other hand, has one connection sending all four images, decreasing the amount of time it takes to receive an entire page's content. Saving time is always a good thing when it comes to the 'Net.