com.HttpServiceRequest.readFormEncodedRequest

Returns the string of a GET request with UTF-8 conversion option.

Syntax

readFormEncodedRequest(
   utf8 INTEGER )
  RETURNS STRING
  1. utf8 specifies if the string must be decoded to the current charset.

Usage

The readFormEncodedRequest() method returns the query of a POST "application/x-www-form-urlencoded" request or the query string of a GET request, decoded depending on HTML4 or XFORM if utf8 is TRUE.

If the result string contains the UTF-8 encoded special characters "&" or "=", these will be doubled; however, when these characters serve as separators in the query string, they will not be doubled. For example, if the request received is name1=value1&na%26me2=val%3Due2 – where %26 is the encoded value for "&" and %3D is the encoded value for "=" – the method will return name1=value1&na&&me=val==ue2.

If the utf8 parameter is TRUE, the decoded query string is translated from UTF-8 to the current character set. This may lead to a conversion error.

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).

The int_flag variable is checked during GWS API call to handle program interruptions, for more details, see Interruption handling in GWS calls (int_flag)