|
Enfusion Script API
|
Object used as callback structure in which you will receive results of scripted RestAPI calls. More...
Public Member Functions | |
| proto external void | SetOnSuccess (RestCallbackFunc onSuccess) |
| Sets function which will be invoked if request was successful. | |
| proto external void | SetOnError (RestCallbackFunc onError) |
| Sets function which will be invoked if request failed due to some error. | |
| proto external ERestResult | GetRestResult () |
| Returns Rest result of the request. | |
| proto external HttpCode | GetHttpCode () |
| Returns HTTP code result of the request. | |
| proto external string | GetData () |
| Returns raw data received via response as string. | |
| void | OnSuccess (string data, int dataSize) |
| OBSOLETE - WILL BE REMOVED! Use SetOnSuccess() to set callback function instead! | |
| void | OnError (int errorCode) |
| OBSOLETE - WILL BE REMOVED! Use SetOnError() to set callback function instead! | |
| void | OnTimeout () |
| OBSOLETE - WILL BE REMOVED! Use SetOnError() to set callback function instead and check GetRestResult() == ERestResult.EREST_ERROR_TIMEOUT! | |
Public Member Functions inherited from Managed | |
| proto external ref Managed | Clone () |
| Return shallow copy of object, or null if it is not allowed (not public constructor) | |
Object used as callback structure in which you will receive results of scripted RestAPI calls.
For callback function you can use any function without arguments or with RestCallback as the only argument. If RestCallback was provided as the argument it will contain RestCallback used for the request that invoked it. Allowed arguments of the function can be found in typedef of RestCallbackFunc.
Examples of callback functions:
You have to set functions on the RestCallback instance for them to be invoked:
| proto external string RestCallback.GetData | ( | ) |
Returns raw data received via response as string.
| proto external HttpCode RestCallback.GetHttpCode | ( | ) |
Returns HTTP code result of the request.
| proto external ERestResult RestCallback.GetRestResult | ( | ) |
Returns Rest result of the request.
| void RestCallback.OnError | ( | int | errorCode | ) |
OBSOLETE - WILL BE REMOVED! Use SetOnError() to set callback function instead!
OBSOLETE - WILL BE REMOVED! Use SetOnSuccess() to set callback function instead!
| void RestCallback.OnTimeout | ( | ) |
OBSOLETE - WILL BE REMOVED! Use SetOnError() to set callback function instead and check GetRestResult() == ERestResult.EREST_ERROR_TIMEOUT!
| proto external void RestCallback.SetOnError | ( | RestCallbackFunc | onError | ) |
Sets function which will be invoked if request failed due to some error.
Refer to RestCallbackFunc to see what arguments are required for the function.
| proto external void RestCallback.SetOnSuccess | ( | RestCallbackFunc | onSuccess | ) |
Sets function which will be invoked if request was successful.
Refer to RestCallbackFunc to see what arguments are required for the function.