brabo-hi
12/27/2021, 11:48 PMHexa
12/28/2021, 1:36 AMSam Michael
12/28/2021, 3:47 PMChris C
12/29/2021, 10:28 AMktor-server-content-negotiation
, then Gradle tells me No matching variant of io.ktor:ktor-server-content-negotiation:2.0.0-beta-1 was found
. Looking at Maven Central, there doesn’t seem to be native versions of this library. Am I missing something?Jan
12/29/2021, 6:48 PMLucas Milotich
12/29/2021, 8:05 PMAlex Styl
12/30/2021, 12:08 PMAlexandre Brown
12/30/2021, 3:31 PMJan
12/30/2021, 3:59 PMOvsyannikov Alexey
12/31/2021, 11:04 AMJohn O'Reilly
01/01/2022, 2:20 PMKGraphQL
(https://github.com/aPureBase/KGraphQL) but get following when updating to use Ktor 2.0.0-beta-1
Type mismatch.
Required:
Plugin<TypeVariable(P), TypeVariable(B), TypeVariable(F)>
Found:
GraphQL.Feature
Morgan Pittkin
01/01/2022, 11:02 PMIgor Kolomiets
01/02/2022, 4:48 AM@Serializable
data class Age(val value: Int)
@Serializable
data class Update<T>(val old: T, val new: T)
fun main() {
embeddedServer(Netty, port = 8080) {
install(ContentNegotiation) {
json()
}
routing {
update<Age>()
}
}.start(wait = true)
}
inline fun <reified T> Route.update() {
post("/") {
val update = call.receive<Update<T>>()
<http://application.log.info|application.log.info>("XXX update={}", update)
call.respond(HttpStatusCode.OK, "OK")
}
}
Trying
% curl -v -H "Content-Type: application/json" -POST <http://localhost:8080/|http://localhost:8080/> -d '{"old":{"value":1},"new":{"value":2}}'
makes Ktor throw:
java.lang.UnsupportedOperationException: This function has a reified type parameter and thus can only be inlined at compilation time, not called directly.
I found similar issue https://youtrack.jetbrains.com/issue/KTOR-582 that was identified as Kotlin compiler’s issue and eventually resolved as Fixed.
Could this be regression with Kotlin compiler again? If not, can somebody advise how to avoid this exception? My project really needs such generic Route.update()
function.
Thank you!Artem Chepurnoy
01/04/2022, 11:00 AMktor:2.0.0-beta-1
on Android 5.0 I'm getting a crash:
java.lang.NoSuchMethodError: No virtual method position(I)Ljava/nio/ByteBuffer; in class Ljava/nio/ByteBuffer; or its super classes (declaration of 'java.nio.ByteBuffer' appears in /system/framework/core-libart.jar)
at io.ktor.utils.io.bits.MemoryJvmKt.sliceSafe(MemoryJvm.kt:212)
at io.ktor.utils.io.bits.Memory.slice-87lwejk(MemoryJvm.kt:48)
explained here https://jira.mongodb.org/browse/JAVA-2559
Is the ktor 2.0 still compatible with Android 5.0+ or not anymore?phldavies
01/04/2022, 11:12 AMTestApplicationEngine
when using the new testApplication
API (and is there any link to the 2.0 docs anywhere? I can’t seem to find anything to help navigating the new APIs)edwinRNDR
01/04/2022, 1:16 PMcookie.extensions["SameSite"] = "None; Secure"
without the semicolon being escaped in the cookie output?nordiauwu
01/04/2022, 2:59 PMElliot Barlas
01/04/2022, 7:56 PMbrabo-hi
01/05/2022, 8:25 AMRescribet
01/05/2022, 8:47 AMlib/<projectname>-<version>.jar
file has disappeared and running fails with an error:
Exception in thread "main" java.lang.IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf
I’ve tried reproducing by using the (CIO) ‘full stack web application’ project generator which basically fails with the same error, since it doesn’t use HOCON:
Caused by: java.lang.ClassNotFoundException: com.test.fullstack.application.ServerKt
bsimmons
01/05/2022, 10:48 PMChris C
01/06/2022, 5:41 PMappendIfNameAndValueAbsent()
)
public fun StringValuesBuilder.appendIfNameAbsent(name: String, value: String): StringValuesBuilder = apply {
if (!contains(name)) return@apply
append(name, value)
}
I think that if
should be invertedbrabo-hi
01/06/2022, 10:50 PMinstall(Logging)
how can we log request and response bodyChris C
01/07/2022, 12:21 PMjava.lang.IllegalArgumentException: List has more than one element
because there are two values in the Accept header. Removing jackson fixes it, but I was hoping to use the same client for json responses too. Is this possible? I’m using 2.0.0-beta-1.
class AcceptTest {
private val readmeContentType = ContentType.parse("application/vnd.github.v3.html")
@Test
fun acceptTest() {
val client = HttpClient() {
install(ContentNegotiation) {
jackson { }
}
}
val readme: String = runBlocking {
client.get("<https://api.github.com/repos/ktorio/ktor/readme>") {
header(HttpHeaders.Accept, readmeContentType)
}.body()
}
println(readme)
}
}
jozefdransfield
01/07/2022, 1:43 PMJan
01/07/2022, 11:39 PMsocket = http.webSocketSession(
generateWebsocketURL(
config.encoding,
config.compression
)
) { timeout { this.connectTimeoutMillis = 5000; this.socketTimeoutMillis = 2 * 60 * 1000 } }
saket
01/08/2022, 1:00 AMRahul Rawat
01/08/2022, 3:35 PM{
"address": {
"id": 1,
"firstname": "\"Rahul\"",
"lastname": "\"Rawat\"",
"address1": "\"Address1\"",
"address2": "\"Address2\"",
"city": "\"City\"",
"zipCode": "\"ZipCode\"",
"phone": "\"80808080\"",
"state_name": "\"State\"",
"alternative_phone": "\"Alternative\"",
"company": "\"Company\"",
"state_id": 1,
"country_id": 2
}
}
My server looks like the following
install(ContentNegotiation) {
json(Json {
prettyPrint = true
isLenient = true
})
}
Please someone help.Arnab
01/10/2022, 1:57 PM200
or 503
?Rescribet
01/11/2022, 4:11 PMUrl
vs URLBuilder
😕Rescribet
01/11/2022, 4:11 PMUrl
vs URLBuilder
😕Matteo Mirk
01/11/2022, 5:03 PMRescribet
01/12/2022, 12:04 AMURLBuilder
produces Url
objectsMatteo Mirk
01/12/2022, 11:03 AMUrl
probably…Ben Woodworth
01/12/2022, 10:22 PMMatteo Mirk
01/13/2022, 9:06 AMRescribet
01/15/2022, 6:20 PM