Enfusion Script API
Loading...
Searching...
No Matches
RestCallback Interface Reference
Inheritance diagram for RestCallback:
Managed

Public Member Functions

void OnSuccess (string data, int dataSize)
 Called when data arrived and/ or response processed successfully Override this with your implementation.
 
void OnError (int errorCode)
 Called in case request failed (ERestResult) - Note! May be called multiple times in case of (RetryCount > 1) Override this with your implementation.
 
void OnTimeout ()
 Called in case request timed out or handled improperly (no error, no success, no data) Override this with your implementation.
 
void OnFileCreated (string fileName, int dataSize)
 OnFileCreated is OBSOLETE - Will be removed.
 
- 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)
 

Detailed Description


object to be used from script for result binding

[Example:]

RestCallback cbx1 = new RestCallback;
RestContext ctx = g_Game.GetRestApi().GetContext("http://somethingsomewhere.com/path/");
ctx.GET(cbx1,"RequestPath?Argument=Something");

Event are then called upon RestCallback()

Member Function Documentation

◆ OnError()

void RestCallback.OnError ( int errorCode)

Called in case request failed (ERestResult) - Note! May be called multiple times in case of (RetryCount > 1) Override this with your implementation.

Print(" !!! OnError() ");
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.

◆ OnFileCreated()

void RestCallback.OnFileCreated ( string fileName,
int dataSize )

OnFileCreated is OBSOLETE - Will be removed.

◆ OnSuccess()

void RestCallback.OnSuccess ( string data,
int dataSize )

Called when data arrived and/ or response processed successfully Override this with your implementation.

Print(" !!! OnSuccess() size=" + dataSize );
if( dataSize > 0 )
Print(data); // !!! NOTE: Print() will not output string longer than 1024b, check your dataSize !!!

◆ OnTimeout()

void RestCallback.OnTimeout ( )

Called in case request timed out or handled improperly (no error, no success, no data) Override this with your implementation.

Print(" !!! OnTimeout() ");

The documentation for this interface was generated from the following file: