com.HttpRequest.getResponse

Waits for and returns the response produced by one of request methods.

Syntax

getResponse()
  RETURNS com.HttpResponse

Usage

The getResponse() method waits for a response from the server and 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().

Note: On iOS, a long running HTTP request will display a message box, to allow the user to cancel the request. If the user cancels the HTTP request, the error -15578 will be raised. This error can be trapped with TRY/CATCH.

Unlike getAsyncResponse(), the getResponse() method is blocking: it stops program flow until an HTTP response is received from the server.

Define a response timeout with the com.HttpRequest.setTimeOut method.

Note: On iOS devices, when using this method, it is not possible to distinguish different timeouts for the connection and for read/write operation, defined respectively by the setConnectionTimeOut() and setTimeOut() methods. If both timeouts are defined, the longest timeout will be used for the connection and read/write operations.

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)