Specifications
Web Server Responses (Content Handlers)
When a le is requested, the web server handles the le using the response specied
for the le’s sux. Responses, also known as content handlers, can be an action or a
MIME type. Likely responses include:
Return le as MIME type (you enter the mapping you want to return) Â
Send-as-is (send the le exactly as it exists) Â
Cgi-script (run a CGI script you designate) Â
Imap-le (generate an IMAP mail message) Â
Mac-binary (download a compressed le in MacBinary format) Â
MIME type mappings are divided into two subelds separated by a forward slash,
such as text/plain.
Mac OS X Server includes a list of default MIME type mappings. You can edit these
and add others using Server Admin.
When you specify a MIME type as a response, the server identies the type of data
requested and sends the response you specify. For example, if the browser requests
a le with the sux “jpg” and its associated MIME type mapping is image/jpeg, the
server knows it needs to send an image le and that its format is JPEG. The server
doesn’t need to do anything except serve the data requested.
Actions are handled dierently. If you’ve mapped an action to a sux, your server
runs a program or script, and the result is served to the requesting browser. For
example, if a browser requests a le with the sux “cgi” and its associated response
is the action cgi-script, your server runs the script and returns the resulting data to
the requesting browser.
18 Chapter 1 Web Technologies Overview