When a resource is requested via the HTTP protocol, the web server sends an HTTP response consisting of one or more headers, a blank line (CR+LF) and the document body. For a web page, the body is the HTML or XHTML document, i.e., the markup we write.
The HTTP headers provide meta-information about the document. One of the most important headers is Content-Type, which informs the user agent what type of content the response body contains. It may also convey information about which character encoding it uses. For HTML, such a header can look like this:
Code: Content-Type: text/html; charset=iso-8859-1
The text/html part consists of a MIME media type name (text) and subtype name (html). The charset part is an optional attribute.