ktor Questions

3

I've been spending way too much time trying to solve this problem. So the code that I posted below does work in terms of downloading a file, but the problem is, the flow has a very unexpected behav...
Intervalometer asked 30/11, 2020 at 23:41

4

The follow is deprecated but work. routing { static("/static") { resources("files") } } When I write (https://ktor.io/docs/serving-static-content.html#index) it does not wor...
Csch asked 24/4, 2023 at 11:9

6

Solved

I have a problem with the serialization of a class in Kotlin. build.gradle.kt ... plugins { application kotlin("jvm") version "1.6.21" kotlin("plugin.serialization"...
Vincent asked 24/4, 2022 at 11:56

3

Solved

I am using Ktor client for Android together with the plugin: io.ktor:ktor-client-auth:1.6.4. The current implementation is similar to this snippet. Now I want to implement a 'log out' function when...
Motteo asked 16/11, 2021 at 15:23

2

Solved

so trying to understand how I can make testing ktor app with testcontainers this is my code package com.app import com.app.base.db.DbFactory import com.app.features.auth.RegisterDTO import com.app...
Drugget asked 6/6, 2022 at 16:8

2

Solved

I'm trying to reach a server, which is occasionally slow. The ktor client I'm using is crashing with an Exception in thread "main" kotlinx.coroutines.TimeoutCancellationException: Timed o...
Retaliation asked 17/11, 2020 at 14:28

3

Solved

I am trying to connect to a service that has a self signed certificate from an internal testing environment that will only exist during prototyping. The Ktor client fails with javax.net.ssl.SSLHand...
Rigsdaler asked 5/3, 2021 at 10:33

3

I am trying to learn Ktor, when responding to a GET request, I found that the trailing slash is treated as two routes, for example: /greet?name=john /greet/?name=john Is it possible to define one ...
Burck asked 26/3, 2022 at 3:19

3

I'm using the Ktor HttpClient(CIO) to make requests against an HTTP API whose response uses chunked transfer encoding. Is there a way using the Ktor HttpClient(CIO) to get access to the individual...
Gameness asked 28/5, 2020 at 15:6

3

Solved

I am taking my first look at Kotlin Multiplatform and am following the guide here https://kotlinlang.org/docs/multiplatform-mobile-upgrade-app.html I have my class @Serializable data class RocketLa...
Rattlesnake asked 19/4, 2023 at 9:46

2

Solved

Really stuck with translating multipart request from retrofit to ktor client. In retrofit I have following method: @Multipart @POST("rest/sendPhotos") suspend fun sendPhotos(@Part file...
An asked 29/12, 2023 at 12:0

4

Hey I am working in Ktor. I found this answer to show log in specific platform iOS and Android. But when I am building this through gradle I am getting error on this when running this command on te...
Thresher asked 3/5, 2022 at 16:42

2

Solved

I'm building a server side application in Kotlin, using the Ktor framework. When I run the application, I receive a NoClassDefFoundError. The stacktrace is shown below: Caused by: java.lang.NoClass...
Rijeka asked 15/9, 2021 at 18:53

1

Solved

When run from the IDE the migrations are fine Output: INFO: Successfully applied 1 migration to schema `db`, now at version v1 But when I run the application from a container then Output: example ...
Jobi asked 4/10, 2023 at 9:49

4

Solved

I have written a common code in a common module as below and tested in JS environment val response = client.post<HttpResponse>(url) { body = TextContent("""{"a":1,"b":2}""", ContentType.Ap...
Deragon asked 13/2, 2019 at 21:20

6

I got something like this: private val client = HttpClient { install(JsonFeature) { serializer = GsonSerializer() } install(ExpectSuccess) } and make request like private fun HttpRequestBu...
Laywoman asked 6/11, 2018 at 8:18

1

I'm trying Ktor for a project but the sample project generated by the Ktor plugin does not work. There is a problem with the CIO engine import. When I put import io.ktor.client.engine.cio.* it says...
Leoni asked 16/10, 2020 at 14:16

9

Solved

I'm trying to fetch and deserialize some data that is being hosted on github. { "Meals": [ { "id": "1598044e-5259-11e9-8647-d663bd870b02", "name": "...
Holdup asked 2/12, 2020 at 9:12

2

Solved

I'm very new to Kotlin and Ktor and Gradle. Was able to create embedded server as explained in Ktor site, with the following code: BlogApp.kt: package blog import org.jetbrains.ktor.netty.* impo...
Lid asked 22/9, 2017 at 13:8

2

Solved

How can I post file as multipart/form-data use ktor client? I want to use it for telegram bot API "send document". I need to achieve the same result as the curl command curl -F document=@...
Cissy asked 3/11, 2021 at 19:51

3

Solved

I'm currently creating my application using Ktor Netty Engine I searched the docs for any feature to handle sending emails when a user sends a request to my server but found nothing. post("/ap...
Gouda asked 10/3, 2021 at 19:24

6

Solved

Does the Ktor framework provide a way of accessing a route's path string within a request? For example, if I set up a route such as: routing { get("/user/{user_id}") { // possible to ge...
Tombstone asked 9/6, 2020 at 10:45

2

Solved

I am trying out Ktor by converting some existing project that's currently using Retrofit. Although I could easily convert the request into something like: client.get { url("$BASE_URL/something/s...
Median asked 25/2, 2020 at 17:11

4

Solved

I am using Ktor 1.2.2 and I have an InputStream object that I want to use as the body for an HttpClient request I make down the line. Up until Ktor 0.95 there was this InputStreamContent object tha...
Elana asked 21/6, 2019 at 15:34

3

Solved

How do you achieve the following using Koin DI: single { AValidator() } bind IValidator::class single { BValidator() } bind IValidator::class single { CValidator() } bind IValidator::class single ...
Torgerson asked 25/1, 2019 at 23:18

© 2022 - 2025 — McMap. All rights reserved.