iTP Secure WebServer System Administrator's Guide (Version 7.0)

Using Common Gateway Interface (CGI) Programs
iTP Secure WebServer System Administrator’s Guide523346-012
8-27
Server Headers
A Web client cannot properly interpret CGI program output unless it knows the output
data (MIME) type. Therefore, every response generated by a CGI program must
contain a Content-type: header. For example:
Content-type: text/html
Clients ignore any headers they are unable to interpret.
Server Headers
Two headers (Location: and Status:) are used by CGI programs to pass
information to the server rather than directly to the Web client. These headers cause
the server to modify its response to the Web client.
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.
Log-.* Specifies that a CGI script should generate name and value
entries in the iTP Secure WebServer’s extended log file by writing
out special HTTP headers.
For example:
Log-userid: bobmac
This example generates the following entry in the extended log file:
(cgi-userid bobmac)
This header is optional.
Status: Specifies the status of the request. The valid status codes are
listed in Table C-2, HTTP Status Codes, on page C-3.