RestClient

constructor(clientInfo: RestClient.ClientInfo, authToken: String, httpAccessor: HttpAccess, authTokenProvider: RestClient.AuthTokenProvider)

Constructs a RestClient with the given clientInfo, authToken, httpAccessor and authTokenProvider. When it gets a 401 (not authorized) response from the server:

  • If authTokenProvider is not null, it will ask the authTokenProvider for a new access token and retry the request a second time.
  • Otherwise it will return the 401 response.

Parameters

clientInfo
authToken
httpAccessor
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. The tokenType determines the Authorization header scheme (e.g. "Bearer" or "DPoP").

Parameters

clientInfo
authToken
tokenType
httpAccessor
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. The tokenType determines the Authorization header scheme (e.g. "Bearer" or "DPoP"). The credentialsIdentifier is used to look up the DPoP key pair.

Parameters

clientInfo
authToken
tokenType
credentialsIdentifier
httpAccessor
authTokenProvider