commonMain.app.moviebase.provider.unogs.Unogs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of movie-providers-js Show documentation
Show all versions of movie-providers-js Show documentation
Kotlin Multiplatform library to access several Movie Providers.
package app.moviebase.provider.unogs
import app.moviebase.provider.core.remote.HttpClientFactory
import app.moviebase.provider.core.remote.StreamingLogLevel
import app.moviebase.provider.unogs.api.UnogsApi
import io.ktor.client.*
import io.ktor.client.request.*
class Unogs(
apiKey: String,
logLevel: StreamingLogLevel = StreamingLogLevel.NONE
) {
private val client: HttpClient = HttpClientFactory.build(logLevel) {
it.header(UnogsUrlParameter.API_KEY, apiKey)
it.header(UnogsUrlParameter.API_HOST, UnogsWebConfig.HOST)
it.header(UnogsUrlParameter.USE_QUERY_STRING, true)
}
val api = UnogsApi(client)
}