RestClient

open class RestClient

RestClient allows you to send authenticated HTTP requests to a force.com server.

Constructors

Link copied to clipboard
constructor(clientInfo: RestClient.ClientInfo, authToken: String, httpAccessor: HttpAccess, authTokenProvider: RestClient.AuthTokenProvider)
Constructs a RestClient with the given clientInfo, authToken, httpAccessor and authTokenProvider.
constructor(clientInfo: RestClient.ClientInfo, authToken: String, tokenType: String, httpAccessor: HttpAccess, authTokenProvider: RestClient.AuthTokenProvider)
Constructs a RestClient with the given clientInfo, authToken, tokenType, httpAccessor and authTokenProvider.
constructor(clientInfo: RestClient.ClientInfo, authToken: String, tokenType: String, credentialsIdentifier: String, httpAccessor: HttpAccess, authTokenProvider: RestClient.AuthTokenProvider)
Constructs a RestClient with the given clientInfo, authToken, tokenType, credentialsIdentifier, httpAccessor and authTokenProvider.

Types

Link copied to clipboard
AsyncRequestCallback interface.
Link copied to clipboard
AuthTokenProvider interface.
Link copied to clipboard
open class ClientInfo
All immutable information for an authenticated client (e.g.
Link copied to clipboard
open class OAuthRefreshInterceptor : Interceptor
Network interceptor that does oauth refresh and request retry when access token has expired.
Link copied to clipboard
Exception thrown when refresh token was found to be revoked
Link copied to clipboard
Use a unauthenticated client info when do not need authentication support (e.g.

Properties

Link copied to clipboard
Link copied to clipboard
open var okHttpClient: OkHttpClient
Link copied to clipboard
open val okHttpClientBuilder: OkHttpClient.Builder

Functions

Link copied to clipboard
open fun buildRequest(restRequest: RestRequest): Request
Builds an OK HTTP request from a REST request.
Link copied to clipboard
open fun clearCaches()
Clear caches of org-id/user-id to OkHttpClient.
open fun clearCaches(userAccount: UserAccount)
Remove cached OkHttpClient.
Link copied to clipboard
open fun getAuthToken(): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun newWebSocket(request: Request, listener: WebSocketListener): WebSocket
Returns a new web socket for the provided request and web socket listener.
Link copied to clipboard
Proactively refresh this client's access token through the SDK's standard, app-wide serialized refresh path (the same path used when a request returns 401).
Link copied to clipboard
open fun sendAsync(restRequest: RestRequest, callback: RestClient.AsyncRequestCallback): Call
Send the given restRequest and process the result asynchronously with the given callback.
Link copied to clipboard
open fun sendSync(restRequest: RestRequest): RestResponse
open fun sendSync(restRequest: RestRequest, interceptors: Array<Interceptor>): RestResponse
Send the given restRequest synchronously and return a RestResponse Note: Cannot be used by code on the UI thread (use sendAsync instead).
Link copied to clipboard
open fun toString(): String