Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

FAQ: Frequently Asked Questions about CGI Programming
Section - 2.2 What HTTP request headers can I use?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Forum ]


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?
See reader questions & answers on this topic! - Help others by sharing your knowledge

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).


User Contributions:

Comment about this article, ask questions, or add new information about this topic:




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 | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
Nick Kew <nick@webthing.com>





Last Update March 27 2014 @ 02:12 PM