Managing the Request Queue

The RestClient class internally uses an instance of the OkHttpClient class to manage REST API requests. You can access underlying OkHttp objects directly to cancel pending requests. To manage a specific request, you can use the OkHttp Call object returned by the RestClient.sendAsync() Mobile SDK method.

The following examples show how to perform some common network operations with OkHttpClient.

Common Imports

To get the handle of the OkHttpClient that the current RestClient instance is using:

Kotlin

Java

Kotlin

Java

Kotlin

Java

Kotlin

Java

Kotlin

Java

For more information, see square.github.io/okhttp/.

See Also