Created
June 25, 2022 14:11
-
-
Save alibahaaa/61bde8d2e6c0ea853176d839309033bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.ktor.client.* | |
import io.ktor.client.plugins.contentnegotiation.* | |
import io.ktor.serialization.kotlinx.json.* | |
import kotlinx.serialization.json.Json | |
fun createJson() = Json { isLenient = true; ignoreUnknownKeys = true } | |
fun createHttpClient( | |
json: Json | |
) = HttpClient { | |
install(ContentNegotiation) { | |
json(json) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment