
commonMain.com.algolia.client.transport.Requester.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of algoliasearch-client-kotlin Show documentation
Show all versions of algoliasearch-client-kotlin Show documentation
"Algolia is a powerful search-as-a-service solution, made easy to use with API clients, UI libraries, and pre-built integrations. Algolia API Client for Kotlin lets you easily use the Algolia Search REST API from your JVM project, such as Android or backend implementations."
The newest version!
package com.algolia.client.transport
import io.ktor.util.reflect.*
/**
* This interface represents a requester capable of executing network requests.
*
* Implementations should handle the actual process of making network calls and returning the
* results based on the provided configuration and options.
*/
public interface Requester {
/**
* Executes a network request with the specified configuration and options, then returns the
* result as the specified type.
*
* This is a suspending function, which means it can be used with coroutines for asynchronous
* execution.
*
* @param T The type of the result expected from the request. This should match the returnType
* parameter.
* @param requestConfig The configuration for the network request, including the URL, method,
* headers, and body.
* @param requestOptions Optional settings for the request execution, such as timeouts or cache
* policies. Default value is null.
* @param returnType A TypeInfo object representing the expected return type (T) of the request.
*/
public suspend fun execute(
requestConfig: RequestConfig,
requestOptions: RequestOptions? = null,
returnType: TypeInfo,
): T
public fun setClientApiKey(apiKey: String)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy