Method HttpClient():onBusy() Foundation

Notifies the application about a state change.

Syntax
 
:onBusy( <cState>, <xStateInfo> ) --> lContinue
Parameters
<cState>
A character string with information about the current state of the request operation. See the <xStateInfo> parameter for a list of the state texts which are supported.
<xStateInfo>
This parameter contains supplemental information about the current state of the operation. The value contained in <xStateInfo> and its data type depends on the state in question. The following table lists the states along with the corresponding supplemental information contained in this parameter.
State codes and supplemental information
State Description State Information Data Type
resolving-name Looking up IP address of server Server name C
name-resolved Successfully found the IP address of server Server name C
connecting-to-server Connecting to server IP address in dotted notation C
connected-to-server Successfully connected to server IP address in dotted notation C
sending-request Sending information request NIL U
request-sent Successfully sent the information request Number of bytes sent N
receiving-response Waiting for server to respond NIL U
response-received Successfully received response Number of bytes received N
closing-connection Closing connection to the server NIL U
connection-closed Successfully closed connection to the server NIL U
redirect HTTP request is about to automatically redirect the request New URL C
intermediate-response Received intermediate (100 level) status code message Status code N
secure-failure Error(s) while retrieving SSL certificate from server List of error messages A
request-error Error occurred while sending HTTP request. Info about operation and error DataObject with members :lastError (N) and :operation (C)
sendrequest-complete The request completed successfully. NIL U
Return

:onBusy() should return a logical value indicating whether the HTTP client should continue handling the request. Returning the logical value .T. (true) continues the operation. Returning .F. (false) aborts the send operation.

Description

The callback method :onBusy() is called automatically by the framework to notify the application about state changes while processing a request initiated using :send() or :sendAsync(). :onBusy() can be used for monitoring the various states of a send operation, for example, for updating the user interface with state information. A send operation can also be aborted programmatically at any stage. To do this, the value .F. (false) must be returned by this callback method.

The HTTP client is designed to be as scalable as possible. For this reason, callbacks execute in different threads. No assumption must be made as to which thread may be used to execute a given (or even the same) callback.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.