[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
Single Page
Top Document: FAQ: Frequently Asked Questions about CGI Programming
Previous Document: 2.1 What is HTTP (HyperText Transfer Protocol)?
Next Document: 2.3 What Environment variables are available to my application?
-
Search the FAQ Archives
Single Page
Top Document: FAQ: Frequently Asked Questions about CGI Programming
Previous Document: 2.1 What is HTTP (HyperText Transfer Protocol)?
Next Document: 2.3 What Environment variables are available to my application?
2.2 What HTTP request headers can I use?
Most HTTP request headers are passed to the CGI script as environment variables. Some are guaranteed by the CGI spec. Others are server, browser and/or application dependent. To see what _your_ browser and server are telling each other, just use a trivial little CGI script to print out the environment. In Unix: #!/bin/sh echo "Content-type: text/plain" echo set (Just call it "env.cgi" or something, and put it where your server will execute it. Then point your browser at http://your.server/path/to/env.cgi ). This enables you to see at-a-glance what useful server variables are set. Note that dumping the environment like this within a more complex script can be a useful debugging technique. For details, see the CGI Environment Variables specification at http://hoohoo.ncsa.uiuc.edu/cgi/env.html (which also includes a version of the above script - somewhat more nicely formatted - online).
Top Document: FAQ: Frequently Asked Questions about CGI Programming
Previous Document: 2.1 What is HTTP (HyperText Transfer Protocol)?
Next Document: 2.3 What Environment variables are available to my application?
Single Page
[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
Send corrections/additions to the FAQ Maintainer:
Nick Kew <nick@webthing.com>
Last Update December 05 2008 @ 00:13 AM