$Web_Input_Content

From m204wiki
Revision as of 23:40, 12 April 2013 by JALWiccan (talk | contribs) (Automatically generated page update)
Jump to navigation Jump to search

Retrieve input contents


$Web_Input_Content retrieves the "content" of an HTTP Put or Post sent by a client. $Web_Input_Content returns this content as a longstring.

Syntax

%lstr = $Web_Input_Content( type )

$Web_Input_Content 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. This option was first provided as maintenance to Sirius Mods version 7.3.

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

$Web_Input_Content can be used to examine data from the client in the following situations:

  • An HTTP Put.
  • An HTTP Post where the mime-type is set to something other than application/x-www-form-urlencoded or multipart/form-data.
  • Any HTTP Post if the RAWINPUT parameter is set on the port definition.

Text data retrieved by $Web_Input_Content is not affected by the setting of the JANUS DEFINE, JANUS WEB ON, or $Web_ProcSend parameters CR, LF, or CRLF. But to facilitate subsequent parsing, ASCII carriage returns (X'0D') and linefeeds (X'0A') that a client sends as line-separators are translated by $Web_Input_Content to EBCDIC carriage returns (X'0D') and linefeeds (X'25').

Having the input content as a single longstring might be inconvenient for many applications, especially if the data is line-oriented. It is the application's responsibility to parse this 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_Content is available only in Versions 6.7 and later of the Sirius Mods.

See also $Web_Output_Content and $Web_File_Content.