helpermethod
03/08/2023, 7:43 AMexternalServices
. Are the mock servcices only called by the client created in the testApplicaton
? So if I wanted to make use of those in my application, I'd need to pass in the test client as the client used by my service? The documentation is a little bit unclear.Shubham Singh
03/08/2023, 5:35 PMwebSocket
block in Ktor Server and sendSerialized
the values collected from that flow? In my case, I am observing the changes inside my PostgreSQL DB and returning the changes as a flow from the repository. Now I want to send this flow of values through a websocket connection so that whenever the value inside the flow changes, my websocket also sends a new frame, but right now when I try to do the following:
webSocket(getObservable) {
safeCall {
val id = call.parameters["id"]
repository.getObservable(id = UUID(id)).collect { value ->
sendSerialized(value)
}
}
}
the websocket connection closes as soon as I connect to it.Marcin Wisniowski
03/08/2023, 6:29 PMpipeline.environment.monitor.subscribe(Routing.RoutingCallStarted) { it: RoutingApplicationCall
it.route[..]
}
Where should I look?steamstreet
03/08/2023, 11:51 PM/someotherpage
but short of dissecting the URLs, there doesn’t seem to be a way to create one like there is in the JDK: URL(URL("<http://www.somedomain.com/page>"), "/someotherpage")
Emirhan Emmez
03/09/2023, 8:27 AMplugins {
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'com.google.dagger.hilt.android' version '2.44' apply false
id 'org.jetbrains.kotlin.jvm' version '1.8.10' apply false
}
Ktor version: 2.2.4
JDK version: 11
My Network module:
@Provides
@Singleton
fun createKtorClient(): HttpClient =
HttpClient(Android).config {
defaultRequest {
url("<http://localhost:8080/>")
contentType(ContentType.Application.Json)
accept(ContentType.Application.Json)
}
install(Logging) {
level = LogLevel.ALL
}
install(ContentNegotiation) {
json()
}
}
Jonas TM
03/09/2023, 12:33 PMOpenAPI
Swagger
Ktor provides plugins for OpenAPI and Swagger. However the documentation is quite limited. Is there currently any way to add information to the documentation like general API infos and single endpoint descriptions? Both plugins also seem to ignore the POST
body definitions, is this a known problem?AmrJyniat
03/09/2023, 2:50 PM400 Bad request
always even I doubled checked on the request data, the code and details in 🧵Slackbot
03/09/2023, 7:00 PMSergey Aldoukhov
03/09/2023, 7:42 PMAmir hossein Abdolmotallebi
03/10/2023, 9:48 PMAdam Brown
03/10/2023, 10:07 PMHttpClient
it's self doesn't know it needs to call it's loadTokens
again, is there anyway to get it to reload it's tokens after a login?Arun Joseph
03/11/2023, 7:51 PMprivate val cookieStorage: CookiesStorage = AcceptAllCookiesStorage()
private val client = HttpClient(engine) {
expectSuccess = true
install(ContentNegotiation) {
json(
Json {
ignoreUnknownKeys = true
prettyPrint = true
}
)
}
install(HttpCookies) {
cookieStorage
}
}
How can I manually clear the cookie stored by HttpCookies?Francis Mariano
03/11/2023, 10:24 PMborisdamato
03/13/2023, 4:40 PMbodyAsText
without interfering with other plugins that might want to do the same? At the moment I see that the body can only be read once, after which it gets consumed. Is there a way to prevent that? Thanksayodele
03/14/2023, 8:45 AMdave08
03/14/2023, 2:50 PMPavel Kunyavskiy [JB]
03/14/2023, 4:20 PMQuap
03/15/2023, 6:08 AMMarcus Cvjeticanin
03/15/2023, 4:01 PMAnders Kirkeby
03/15/2023, 6:10 PMauthorization_code
is returned, and then the token-request is issued witch results in a 200 OK with both the access and refresh token being returned in the body. So everything seems to be good on the strava-side. However, the subsequent callback to /login/authorization-callback
returns a 401 - which I for the life of me cannot understand.
Do any of you have any pointers, or know of any issues with CIO (or something 🤷 )
Code added in the following thread 🫶brabo-hi
03/16/2023, 5:59 AMGabriel Luchtenberg
03/16/2023, 7:10 PMFred Friis
03/16/2023, 8:23 PMQuap
03/16/2023, 9:41 PMQuap
03/16/2023, 9:56 PMneerav
03/17/2023, 11:18 AMCharles Maina
03/17/2023, 11:42 AM"Skipping response body transformation from HttpStatusCode to OutgoingContent for the POST /register request because the HttpStatusCode type is ignored. See [ContentNegotiationConfig::ignoreType]". Anyone knows how I can go about it? I have tried searching online first.
This is how I am installing content negotiation.
fun Application.configureSerialization() {
install(ContentNegotiation) {
json()
}
}
Manasseh
03/17/2023, 2:07 PMArjan van Wieringen
03/18/2023, 9:04 AMManasseh
03/18/2023, 6:31 PM