Managing Requests
The SalesforceNetwork library for iOS defines two primary objects, SFNetworkEngine and SFNetworkOperation. SFRestRequest internally uses a SFNetworkOperation object to make each server call.
If you’d like to access the SFNetworkOperation object for any request, you have two options.
-
The following methods return
SFNetworkOperation*:-
[SFRestRequest send:] -
[SFRestAPI send:delegate:]
-
-
SFRestRequestobjects include anetworkOperationobject of typeSFNetworkOperation*.
To cancel pending REST requests, you also have two options.
-
SFRestRequestprovides a new method that cancels the request: -
And
SFRestAPIhas a method that cancels all requests currently running:
To cancel all requests:
To cancel a single request: