com.HttpRequest.getAsyncResponse

Retrieves an asynchronous response produced by one of the request methods.

Syntax

getAsyncResponse()
  RETURNS com.HttpResponse

Usage

If a response is available, the getAsyncResponse() method returns a com.HttpResponse object corresponding to the response that was produced by a call to one of the request methods: doRequest(), doTextRequest(), doXmlRequest(), doFormEncodedRequest(), or beginXmlRequest() and endXmlRequest().

Unlike getResponse(), the getAsyncResponse() method retrieves an asynchronous response because it is non-blocking and returns immediately without stopping the program flow while waiting for a response.

The method returns NULL if the HTTP response has not yet been received from the server, indicating that the request is still in process.

This method is typically called just after a do*Request() call, and if the returned value is NULL, it is called again after a short period of time, to check for a response. For example, within a dialog, use an ON IDLE block to issue a getAsyncRequest() every second.

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)