$Web Input Content: Difference between revisions
 Created page with "{{DISPLAYTITLE:$Web_Input_Content}} <span class="pageSubtitle"><section begin="desc" />Retrieve input contents<section end="desc" /></span>    $Web_Input_Content retrieves the "c..."  | 
				No edit summary  | 
				||
| (22 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_Input_Content}}  | {{DISPLAYTITLE:$Web_Input_Content}}  | ||
<span class="pageSubtitle"  | <span class="pageSubtitle">Retrieve input contents</span>  | ||
<var>$Web_Input_Content</var> retrieves the "content" of an HTTP Put or Post sent by a client. <var>$Web_Input_Content</var> returns this content as a longstring.  | |||
$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==  | ==Syntax==  | ||
<p class="syntax"><  | <p class="syntax"><span class="term">%lstr</span> = <span class="literal">$Web_Input_Content</span>( [<span class="term">type</span>] )  | ||
<  | </p>  | ||
<var>$Web_Input_Content</var> takes a single optional argument and returns a longstring.  | |||
<table class="syntaxTable">  | <table class="syntaxTable">  | ||
<tr><th>type</th>  | <tr><th>type</th>  | ||
<td>A case-independent string set to one of the following:  | |||
<table class="syntaxTable">  | <table class="syntaxTable">  | ||
<tr><th>Text</th>  | <tr><th>Text</th>  | ||
<td>The data is text and is to be translated from ASCII to EBCDIC.</td></tr>  | <td>The data is text and is to be translated from ASCII to EBCDIC.</td></tr>  | ||
| Line 21: | Line 18: | ||
<td>The data is to be left unchanged.</td></tr>  | <td>The data is to be left unchanged.</td></tr>  | ||
<tr><th>TextUtf8</th>  | <tr><th>TextUtf8</th>  | ||
<td>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 <var class="product">[[Janus Web Server]]</var> connection. This option was first provided as maintenance to ''[[Sirius Mods]]'' version 7.3.  | |||
</td></tr>  | |||
<td>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   | </table>  | ||
</td></tr></table>  | |||
''type'' is an optional argument, and it defaults to <tt>Binary</tt>.  | ''type'' is an optional argument, and it defaults to <tt>Binary</tt>.  | ||
</td></tr></table>  | </td></tr>  | ||
</table>  | |||
<var>$Web_Input_Content</var> can be used to examine data from the client in the following situations:  | |||
<ul>  | <ul>  | ||
<li>An HTTP Put.    | <li>An HTTP Put.    | ||
<li>An HTTP Post where the mime-type is set to something other than<tt>application/x-www-form-urlencoded</tt> or <tt>multipart/form-data</tt>.    | <li>An HTTP Post where the mime-type is set to something other than <tt>application/x-www-form-urlencoded</tt> or <tt>multipart/form-data</tt>.    | ||
<li>Any HTTP Post if the RAWINPUT parameter   | <li>Any HTTP Post if the <var>[[RAWINPUT (JANUS DEFINE parameter)|RAWINPUT]]</var> parameter is set on the port definition.  | ||
</ul>  | </ul>  | ||
<blockquote> Text data retrieved by <var>$Web_Input_Content</var> is not affected by the setting of the JANUS DEFINE, JANUS WEB ON, or <var>$Web_ProcSend</var> 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 <var>$Web_Input_Content</var> to EBCDIC carriage returns (X'0D') and linefeeds (X'25').</blockquote>   | |||
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#Longstrings and $functions|"Longstrings and $functions"]]) or [[Stringlist class]] parsing methods (the <var>[[ParseLines (Stringlist subroutine)|ParseLines]]</var> method is likely to be particularly helpful).    | |||
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   | |||
$Web_Input_Content is available   | <var>$Web_Input_Content</var> is available as of version 6.7 of the <var class="product">Sirius Mods</var>.    | ||
See also [[$Web_Output_Content]] and [[$Web_File_Content]].  | See also <var>[[$Web_Input_Header]]</var>, <var>[[$Web_Output_Content]]</var>, and <var>[[$Web_File_Content]]</var>.  | ||
[[Category:Janus Web Server $functions|$Web_Input_Content]]  | [[Category:Janus Web Server $functions|$Web_Input_Content]]  | ||
Latest revision as of 16:02, 17 June 2016
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:
 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 as of version 6.7 of the Sirius Mods.
See also $Web_Input_Header, $Web_Output_Content, and $Web_File_Content.