This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e. HTTP Responses
HTTP responses are similar to HTTP requests. An HTTP response consists of a response line (line 8), followed by zero or more response headers (lines 9-13), followed by an empty line that terminates the headers (line 14), followed by the response body (lines 15-17). A response line has the form
<version> <status code> <status message> The version ﬁeld describes the HTTP version that the response conforms to. The status code is a 3-digit positive integer that indicates the disposition of the request. The status message gives the English equivalent of the error code. Figure 12.42 lists some common status codes and their corresponding messages. The response headers in lines 9-13 provide additional information about the response. The two most important headers are Content-Type (line 12), which tells the client the MIME type of the content in the response body, and Content-Length (line 13), which indicates its size in byte. The empty text line in line 11 that terminates the response headers is followed by the...
View Full Document