com.HTTPRequest.getAsyncResponse

When available, returns the response produced by one of request methods.

Syntax

getAsyncResponse()
  RETURNING result 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 is non-blocking: it returns immediatly and does not stop the program flow when waiting for a response.

The method returns NULL if the HTTP response was not yet received from the server.

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. Within a dialog, use an ON IDLE block to issue a getAsyncRequest() every seconds for example.

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)