newClient

abstract fun newClient(additionalInterceptors: List<RequestInterceptor>, maxRetryCount: Int?): NetworkClient

Creates a new NetworkClient from this instance which will also use the given interceptors.

Its interceptors are this instance's followed by additionalInterceptors:

This instance is unaffected: its requests keep going only through its own interceptors.

Return

A new NetworkClient instance.

Parameters

additionalInterceptors

The interceptors to add after this instance's interceptors.

maxRetryCount

The maximum number of retries of a request, whichever interceptor proposes them; null means no limit. Not inherited from this instance.


open fun newClient(additionalInterceptors: List<RequestInterceptor>): NetworkClient

Same as newClient with a maxRetryCount, with no limit on the number of retries.

Return

A new NetworkClient instance.

Parameters

additionalInterceptors

The interceptors to add after this instance's interceptors.