#set TITLE = "Content types and HTTP headers"
#include top

.SH Content-type:
Most of the time dynamic web content systems such as QUISP generate HTML.
But it is also possible to generate other content types such as a PNG image, plain text,
or an MS Excel spreadsheet.
In a web environment you usually need to tell the user's browser what type the content is so
that it can respond appropriately.. eg. for an Excel spreadsheet it would launch Excel if possible 
to display the content.  Informing the browser is accomplished using an HTTP header statement 
(in plain text) that looks like this:
.IP
\fCContent-Type: application/vnd.ms-excel\fR
.LP
The portion of the statement following the colon is from a standardized controlled vocabulary of content
types called \fBmime types\fR.
.LP
There are a number of other possible HTTP header statements.  One is \fCSet-Cookie\fR, which is discussed
#set FILE = "cgivar.html#cookie"
#set TAG = "here."
#include link
HTTP headers generally tell the user's browser to do something, or provide it with some sort of information.
HTTP headers must be the first content received by the user's browser when a page (or other content) is loaded.
Each header statement is plain text and is terminated by a newline. 
The HTTP headers section is terminated by a blank line 
(two consecutive newlines)... and failure to provide this results in a 500 "server error" message.
.LP
By default, QUISP will assume you are generating HTML content and create a \fCContent-type: text/html\fR header 
automatically.  You can output one or more \fCSet-Cookie\fR header statements as the first printable content
on your page; QUISP will automatically add the blank line terminating the HTTP header section, and generate an
\fC<html>\fR tag.
.LP
If you wish to generate content other than HTML, you need to do the following:
.IP \(bu
include \fCcontenthtml=0\fR in the URL - this turns off QUISP's automatic behavior
.IP \(bu
output your own \fCContent-Type:\fR header and any other HTTP header statements
.IP \(bu
output the all-important blank line
.IP \(bu
output your content.. for binary content the 
#set FILE = "io.html"
#set TAG = "#cat"
#include link
directive may be useful.

#include bottom

