execute

abstract suspend fun execute(request: ApiRequest): Result<ApiResponse>

Executes the given network request asynchronously.

Implementations of this method should be thread-safe, and should not block the calling thread. All exceptions thrown during the execution of the request should be caught and returned as a Result.Failure.

Return

A Result containing either the successful ApiResponse or an Exception.

Parameters

request

The ApiRequest to be executed.