$Web_Input_Header

From m204wiki
Revision as of 16:38, 11 February 2014 by ELowell (talk | contribs) (→‎Syntax)
Jump to navigation Jump to search

Retrieve web request header contents

$Web_Input_Header retrieves the raw web request headers sent by a client. $Web_Input_Header returns this content as a longstring.

Syntax

%lstr = $Web_Input_Header( [type] )

$Web_Input_Header takes a single optional argument and returns a longstring.

type A case-independent string set to one of the following:
Text The data is text and is to be translated from ASCII to EBCDIC.
Binary The data is to be left unchanged.
TextUtf8 The data is UTF-8 and is to be converted to EBCDIC: each two-byte UTF-8 sequence is converted to the corresponding ASCII character, which is then translated to EBCDIC using the translation table in effect for the Janus Web Server connection.

type is an optional argument, and it defaults to Binary.

$Web_Input_Header can be used to examine data from the client if the RAWHEADER parameter is set on the port definition.

Web request header parameters are always separated by ASCII carriage-return/line-feed (X'0D0A') pairs. As such, an application using $Web_Input_Header would probably want to parse the returned longstring using longstring parsing functions (see "Longstrings and $functions") or Stringlist class parsing methods (the ParseLines method is likely to be particularly helpful).

$Web_Input_Header is available only in Versions 7.5 and later of Model 204.

See also $Web_Input_Content, $Web_Output_Content, and $Web_File_Content.