[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Perl HDML Utility Library
Section 37 out of 79 total sections , Section 2 out of 3 sections in this chapter


Generating HTTP headers

Different CGI environments expect different kinds of HTTP headers. Specifically, some Web servers expect a CGI application to output an HTTP status line, such as the following:

However, Netscape servers output the HTTP status line themselves and expect a CGI application to output only other headers and the response body.

The output functions in this library, OutputDeck() and OutputDigest(), assume the Web server is using Netscape conventions unless the application is using PerlIS.dll (on Windows NT).

To explicitly configure the CGI environment for your application, set the $AppUtils::CGI variable. For example, to explicitly configure the environment for Netscape conventions, include the following line before any calls to OutputDeck() or OutputDigest().

This ensures that subsequent calls to OutputDeck() or OutputDigest() generates output that is compatible with Netscape conventions. If your Web server does not use Netscape conventions, you should include the following line.

This ensures that subsequent calls to OutputDeck() or OutputDigest() generates generate output that adds the HTTP status headers.


[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Perl HDML Utility Library
Section 37 out of 79 total sections , Section 2 out of 3 sections in this chapter


Copyright © 1999, Unwired Planet, Inc. All rights reserved.