REQFIELD function


Syntax:

  REQFIELD(identifier [, count])

Searches the HTTP request header for a line that starts with the specified identifier, and returns the value for that identifier. Continuations are included in the value (if the continuation was indicated by the tab character, the tab character is replaced with a space).

The identifier may optionally end with a colon, and the search is case-insensitive. If no matching identifier is found (or if there is no HTTP request header), the null string is returned.

The second, optional, argument determines which value is returned if more than one line starts with the given identifier: if no count is given, the last matching line is used. If a count is given, then it identifies which of the values is to be returned. For example,

  reqfield("accept", 3)

would return the value of the third 'Accept:' line in the header (perhaps "text/html"); if there was no third 'Accept:' line, then the null string would be returned.


[ previous section | GoServe | next section ]

From 'goserve.doc', version 2.00.
Copyright © International Business Machines Corporation, 1993, 1995.
All rights reserved.