Get Content Length

cgiGetMethod

The cgiGetMethod procedure returns the method used to send the URL encoded data to the CGI program.

The cgiGetMethod procedure returns POST or GET depending on the value of the METHOD parameter of the FORM tag of the HTML.

method  cgiGetMethod(
  void          10I 0    Const OPTIONS(*NOPASS)
)

See also: GetEnvVar

Parameters

void [optional]
[input Int(4) (10i0) const]  This parameter is not used.

Return Value

If the function succeeds, the return value is the CGI method (POST or GET) used to transfer the data from the HTML form to the CGI program. The following applies:

When the HTML form contains  <FORM METHOD="POST">  the cgiGetMethod() procedure returns "POST".

When the HTML form contains  <FORM METHOD="GET">  the cgiGetMethod() procedure returns "GET".

Remarks

The value returned is the same as using GetEnvVar('REQUEST_METHOD').

Example

.....DName+++++++++++EUDS.......Length+TDc.Functions+++++++++++++++++++++++++
     D szURLString     S           1024A  
 
.....C..n01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++++
 
     C                   if         cgiGetMethod() = 'POST'
     C                   eval       ReadFromStdin(szURLString)
     C                   elseif     cgiGetMethod() = 'GET'
     C                   eval       szURLString = GetEnvVar('QUERY_STRING')
     C                   endif

The ReadFromStdIn() procedure is a user-written routine that would read from stdin using the QtmhRdStin API.