execute

suspend fun <T> execute(request: suspend () -> SpotifyResult<T>): SpotifyResult<T>

Invokes request, retrying on retryable status codes according to retryPolicy, honoring the Retry-After header when present and falling back to exponential backoff with jitter otherwise.

Return

The API response from the final attempt, whether it succeeded or exhausted retries.

Parameters

request

Suspending function that performs a single request attempt.