Jonathan Mew
01/25/2022, 10:07 AMsudo apt-get libcurl
https://github.com/ktorio/ktor/blob/main/CONTRIBUTING.md?plain=1#L43 Happy to make a PR to fix if you let me know the intention.E: Invalid operation libcurl
sudo apt-get install libcurl-dev
will at least suggest some candidates? (I am on Ubuntu 20.04)turansky
01/25/2022, 4:53 PM/
in the end for Ktor?
/items
== /items/
Osman Saral
01/25/2022, 9:48 PMbrabo-hi
01/25/2022, 11:42 PMrequest Body
?zfan93
01/26/2022, 2:49 AMVáclav Škorpil
01/26/2022, 8:29 AMByteZ
01/26/2022, 4:17 PMcall.receive<ByteArray>().toString(Charsets.UTF_8)
?
I'm aware that call.receiveText()
exists but we had some encoding issues after receiving a request containing a "Fullwidth Colon" (U+FF1A).cafonsomota
01/26/2022, 4:28 PMimplementation("io.ktor:ktor-serialization-kotlinx-xml:2.0.0-beta-1")
However, it seems that I’m unable to use it at the moment - no classes found - at Multiplatform level (Kotlin 1.6.10). Is there something that I might be missing?Javier
01/26/2022, 5:06 PMContentNegotiation
before passing it to Kotlin Serialization
? In commonMain
probably with reflection can be done but I am not finding a way to transform from Type
, KType
or KClass
to to an inner type in KMP (KTOR 2.0.0)brabo-hi
01/26/2022, 9:14 PM1.x
we could do <http://client.post|client.post><MyResponseType>(""){}
but it 2.x
we can’t specify the return type directly?brabo-hi
01/27/2022, 12:07 AM<http://httpclient.ws|httpclient.ws>()
and httpclient.websocket()?
Alan Ramirez
01/27/2022, 3:27 AMRover Sanchez
01/27/2022, 11:23 AMjean
01/27/2022, 2:40 PMRafał Kuźmiński
01/27/2022, 5:43 PMbrabo-hi
01/27/2022, 11:10 PMktor 2.x
? Should we read in a while(true){}
client.wss() {
while (true) {
val customer = receiveDeserialized<Customer>()
}
}
Laurence
01/28/2022, 8:36 AMJavier
01/28/2022, 1:48 PMJavier
01/28/2022, 3:04 PMconverters
in my plugin via scope.pluginOrNull(ContentNegotiation)
, but they are internal, is it possible to get them in another way?ByteZ
01/29/2022, 3:39 PM/
in routes optional? For example I want both localhost/test
and localhost/test/
to work.Victor Yakovlev
02/01/2022, 11:22 AMСтефан Јовановић
02/01/2022, 4:45 PMJan
02/01/2022, 5:28 PMhhariri
02/02/2022, 6:24 AMval DataTransformationPlugin = createApplicationPlugin(name = "DataTransformationPlugin", ::Config) {
// ...
}
It turns out that if the library mode is enabled, it becomes a bit more complicated to read because of the type:
public val DataTransformationPlugin: ApplicationPlugin<Application, Config, PluginInstance> = createApplicationPlugin(name = "DataTransformationPlugin", ::Config) {
}
where Application and PluginInstance are fixed.
We’re thinking about several options on how we can solve this:
First option
Drop obsolete generic parameters from ApplicationPlugin
and keep it as ApplicationPlugin<Config>
We need to introduce _NAME_ApplicationPlugin<Application, Config, PluginInstance>
replacement for existing plugins, so it will be a breaking change.
public val DataTransformationPlugin: ApplicationPlugin<Config> = createApplicationPlugin(name = "DataTransformationPlugin", ::Config) { // ...
}
Second Option
Introduce typealias _NAME_<Config>
and keep ApplicationPlugin
as it is.
public val DataTransformationPlugin: NAME<Config> = createApplicationPlugin(name = "DataTransformationPlugin", ::Config) {
// ...
}
Third Option
Keep ApplicationPlugin<Application, Config, Instance>
as it is.
The problem with introducing NAME is precisely what we could call something that actually already has a name, i.e. ApplicationPlugin. Anything along the lines of “Default”, “Simple” or similar incorrectly could lead to the wrong assumptions.
What are your thoughts on this?Nikolay Kasyanov
02/02/2022, 10:28 AMS.
02/02/2022, 2:38 PMFail to serialize body. Content has type: class .models.NewWord, but OutgoingContent expected.
java.lang.IllegalStateException: Fail to serialize body. Content has type: class .models.NewWord, but OutgoingContent expected.
If you expect serialized body, please check that you have installed the corresponding plugin(like `ContentNegotiation`) and set `Content-Type` header.
My test according to the docs (2.0.0 btw) :
testApplication {
val c = createClient {
install(ContentNegotiation) {
json()
}
}
val r = c.post("/word") {
contentType(ContentType.Application.Json)
setBody(NewWord("a", "b", "c"))
}
}
I also tried header() instead of contentType() but doesn't work either
header(HttpHeaders.ContentType, ContentType.Application.Json.toString())
the NewWord class is Serializable ofc. what am I missing?gps
02/03/2022, 11:55 AMLandry Norris
02/03/2022, 3:42 PMMichael Langford
02/03/2022, 5:46 PMJorge Bo
02/03/2022, 5:59 PMJorge Bo
02/03/2022, 5:59 PMhfhbd
02/03/2022, 6:01 PMJorge Bo
02/03/2022, 6:13 PM