evkaky
10/20/2026, 8:55 AMclient.post("some-url") {
method = HttpMethod.Get
}
Why is this API modelled the way that you can write method = HttpMethod.SomeMethod inside that lambda?
That only makes sense inside a generic client.request method, where you dynamically compose an entire request, including http method
But changing method makes absolutely no sense inside specific methods such as post, get and so on
I checked, this overriding doesn't even work, so if you write method = HttpMethod.Get inside a client.post() { , the effective http method is still going to be post.
But I wonder why is it even allowed to write such a weird constructiongpopides
10/20/2026, 10:02 AMevkaky
10/20/2026, 11:08 AMCLOVIS
10/20/2026, 2:00 PMthat's an implementation detail, which can be changed.not easily 😕 They could have had a different DSL type when the method is already fixed (I do this kind of stuff with KtMongo using interface delegation, but that doesn't play well with
inline methods).
However, migrating to something like that could only be done in a major version and it would probably break a lot of code nowgpopides
10/20/2026, 2:03 PMCLOVIS
10/20/2026, 2:08 PMHttpRequestBuilder and HttpMethodRequestBuilder or some other naming convention.
But even if there was one DSL per method (which is what I'm doing with KtMongo), it's perfectly maintainable using interface delegationevkaky
10/20/2026, 4:08 PMclient.post {
method = HttpMethod.Get
//...
}
as something that they would like to reshape/reimplement a bit, so it becomes impossible to write this in some future versions of ktorCLOVIS
10/21/2026, 7:10 AMevkaky
10/21/2026, 8:11 AMCLOVIS
10/21/2026, 8:14 AMCLOVIS
10/21/2026, 8:15 AMCLOVIS
10/21/2026, 8:24 AM• Please do not ping or mention someone directly to get your questions answered, especially project owners, whether the project is Kotlin or other, unless they specifically indicate that you can.kotlinlang.org/docs/slack-code-of-conduct.html#… Don't worry, they'll see the message at some point. If you want to be sure they do, an issue is the right way
evkaky
10/21/2026, 10:49 AMBruce Hamilton
10/22/2026, 8:28 AM