CGI: Input, Client Header Lines
The header lines recieved from the client, if any, are placed
into the environment with the prefix HTTP_ followed by the header name.
These variables are specific to requests made with HTTP. Interpretation
of these variables may depend on the value of SERVER_PROTOCOL.
The HTTP header name
- is converted to upper case;
- "-" characters are changed to "_" characters;
- has "HTTP_" prepended to give the environment variable name.
The header data may be presented as sent by the client,
or may be rewritten in ways which preserves its semantics.
If multiple headers with the same field-name are received then they
must be rewritten as a single header having the same semantics.
A header that is received on more than one line must be merged onto a
single line.
The server must, if necessary, change the representation of the data
(for example, the character set) to be appropriate for a
CGI environment variable.
The server is not required to create environment variables for
all the headers that it receives.
It may exclude any headers which it has already processed,
such as Authorization, Content-type, and Content-length.
In particular, it may remove any
headers carrying authentication information, such as "Authorization";
it may remove headers whose value is available to the script via other
variables, such as "Content-Length" and "Content-Type".
If necessary, the server may choose to exclude any or all of these
headers if including them would exceed any system environment limits.
A couple of the often-used headers are:-
- HTTP_REFERER
The URL of the refering page, i.e. the page that the client is
following the link from.
- HTTP_USER_AGENT
The browser the client is using to send the request.
General format: software/version library/version.
|