iTP Secure WebServer System Administrator's Guide (Version 7.0)
Using Common Gateway Interface (CGI) Programs
iTP Secure WebServer System Administrator’s Guide—523346-012
8-26
Returning Output
The environment variable CONTENT_LENGTH specifies the number of bytes on
standard input.
For detailed information about processing forms input parameters, consult an
appropriate HTML resource.
Returning Output
Any output a CGI program writes to standard output is passed by the server to the
Web client. This output has three components:
•
One or more HTTP response headers
These headers contain descriptive information about the server response to a
request, such as the content (data) type, the number of bytes, and the expiration
time.
•
A blank line
This blank line is mandatory, even no content follows it. This requirement is
imposed by RFC 822; to see RFC 822, use the following URL:
http://www.faqs.org/rfcs/rfc822.html
•
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.
A 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 on page 8-27 lists CGI response headers.