What is received by the script through standard input? Most browsers
currently in use only use standard input to send to the script the
user-entered HTML form data. This is done when the form is submitted using
the POST method. The less common PUT method also provides data to a script
over standard input. The HTML form data is sent by the browser to the
server in the request body. The request body usually has a
content type of application/x-www-form-urlencoded. If this is
the content type of the request body, the server automatically converts the
form data into EBCDIC before providing it to the script.
If another content type is provided by the browser, then no conversion takes place and it is up to the script program to perform its own conversions. This would make it possible for a script to accept a multi-part document as form input. Since each part could require a different type of conversion (or no conversion at all), having the server blindly convert everything wouldn't work in these cases.
For example, if the URL
/cgi-bin/cgitest?This+Isn't+%41+Big+Deal is requested, the
Query String would be passed into the script as command line parameters:
CALL WWWCGI/CGITEST PARM('This' 'Isn''t' '%41' 'Big' 'Deal')
Notice that the capital "A" is passed in escaped to hex 41 ("%41") which is the ASCII code point for that letter. The Web Server/400 API UnEscape Read Data can be used to unescape this data to an EBCDIC string.
Note: Command line parameters to scripts written in REXX/400 are slightly different. These parameters are not separated into multiple parameters but are sent in as one single parameter. Any pluses ("+") are converted to spaces first.