mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-25 02:14:32 +01:00
30 lines
808 B
Kotlin
30 lines
808 B
Kotlin
@file:Suppress("FunctionName")
|
|
|
|
package common
|
|
|
|
import io.ktor.client.HttpClient
|
|
import io.ktor.client.features.HttpTimeout
|
|
import io.ktor.client.features.json.JsonFeature
|
|
import io.ktor.client.features.json.serializer.KotlinxSerializer
|
|
import io.ktor.client.features.logging.DEFAULT
|
|
import io.ktor.client.features.logging.LogLevel
|
|
import io.ktor.client.features.logging.Logger
|
|
import io.ktor.client.features.logging.Logging
|
|
import kotlinx.serialization.json.Json
|
|
|
|
internal val client = HttpClient {
|
|
install(HttpTimeout)
|
|
install(JsonFeature) {
|
|
serializer = KotlinxSerializer(
|
|
Json {
|
|
ignoreUnknownKeys = true
|
|
isLenient = true
|
|
}
|
|
)
|
|
}
|
|
install(Logging) {
|
|
logger = Logger.DEFAULT
|
|
level = LogLevel.INFO
|
|
}
|
|
}
|