You are previewing HTTP: The Definitive Guide.

HTTP: The Definitive Guide

Cover of HTTP: The Definitive Guide by David Gourley... Published by O'Reilly Media, Inc.
O'Reilly logo

Media Type and Charset

The Content-Type header field describes the MIME type of the entity body.[7] The MIME type is a standardized name that describes the underlying type of media carried as cargo (HTML file, Microsoft Word document, MPEG video, etc.). Client applications use the MIME type to properly decipher and process the content.

The Content-Type values are standardized MIME types, registered with the Internet Assigned Numbers Authority (IANA). MIME types consist of a primary media type (e.g., text, image, audio), followed by a slash, followed by a subtype that further specifies the media type. Table 15-1 lists a few common MIME types for the Content-Type header. More MIME types are listed in Appendix D.

Table 15-1. Common media types

Media type

Description

text/html

Entity body is an HTML document

text/plain

Entity body is a document in plain text

image/gif

Entity body is an image of type GIF

image/jpeg

Entity body is an image of type JPEG

audio/x-wav

Entity body contains WAV sound data

model/vrml

Entity body is a three-dimensional VRML model

application/vnd.ms-powerpoint

Entity body is a Microsoft PowerPoint presentation

multipart/byteranges

Entity body has multiple parts, each containing a different range (in bytes) of the full document

message/http

Entity body contains a complete HTTP message (see TRACE)

It is important to note that the Content-Type header specifies the media type of the original entity body. If the entity has gone through content ...

The best content for your career. Discover unlimited learning on demand for around $1/day.