iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)

Using Common Gateway Interface (CGI) Programs
iTP Secure WebServer System Administrator’s Guide523346-002
8-27
Response Headers
The response content
The response content is the actual object being returned to a web client. For
example, this content might consist of an HTML document, an image, or an audio
file.
The following is a very simple example of output from a CGI program:
Content-type: text/html
<HTML><HEAD>
<TITLE>Example output</TITLE>
</HEAD><BODY>
This is the HTML document generated by a CGI program.
</BODY></HTML>
Response Headers
The headers used in all CGI responses take the form:
head_name: head_value
Table 8-5 lists CGI response headers.
Table 8-5. CGI Response Headers
Header Name Description
Content-encoding: Specifies the data compression code. The valid values are:
x-compress (for standard UNIX compression)
x-gzip (for GNU zip compression)
Content-length: Specifies the length of the output data in bytes.
This header is optional.
Content-type: Specifies a valid MIME type in the format type/subtype. See
Example 8-1
on page 8-8 for a MIME resource that provides a
complete list of the valid MIME types and subtypes.
Note: All CGI programs must send this header.
Expires: Specifies the date and time by which the web client should
consider the output invalid.
For example:
Monday, 13-Feb-95 12:00:00 GMT
This header is optional.
Location: Specifies the location of a new file for the server or client to
retrieve. The search begins at the server’s root directory.
This header is optional.