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:]

  • SFRestRequest objects include a networkOperation object of type SFNetworkOperation*.

To cancel pending REST requests, you also have two options.

  • SFRestRequest provides a new method that cancels the request:

  • And SFRestAPI has a method that cancels all requests currently running:

To cancel all requests:

To cancel a single request: