https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
ktor
  • j

    jean

    12/01/2021, 1:11 PM
    I have this simple class that I use as a model for a a GET call with ktor
    @Serializable
    data class MeasurementsEndpoint(
        @SerialName("measurements")
        val measurements: List<Measurement>,
    
        @SerialName("measurementGroups")
        val measurementGroups: Map<String, MeasurementGroup>,
    )
    the call is made like so
    http.get<MeasurementsEndpoint>(…)
    nothing fancy here, but for some reason I get the error
    kotlinx.serialization.MissingFieldException: Fields [measurements, measurementGroups] are required for type with serial name ‘no.beiningbogen.snute.sharedlibrary.library.model.endpoint.MeasurementsEndpoint’, but they were missing
    When I test my request locally I don’t get this error, it only happens when I run the request from android or iOS clients. Any idea what I’m doing wrong?
    a
    • 2
    • 2
  • h

    hhariri

    12/01/2021, 3:09 PM
    📣 Folks, would appreciate your feedback on this! https://twitter.com/JetBrainsKtor/status/1466061672481796103 📣
    👍 1
    t
    b
    +5
    • 8
    • 11
  • a

    Aljoscha Grebe

    12/01/2021, 10:57 PM
    Hi, I'm trying to use ktor-network to send and receive some data over UDP. I have however run into a problem which I was able to break down to a few lines of code:
    suspend fun main() {
        val socket = aSocket(ActorSelectorManager(<http://Dispatchers.IO|Dispatchers.IO>)).udp().connect(InetSocketAddress("localhost", 1111))
    
        val input = socket.openReadChannel()
    
        input.readByte() // This line causes the exception
    }
    This code always throws the following exception:
    Exception in thread "main" java.lang.IllegalStateException: Handler for READ is already registered
    	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    	at io.ktor.utils.io.ExceptionUtilsJvmKt$createConstructor$$inlined$safeCtor$1.invoke(ExceptionUtilsJvm.kt:103)
    	at io.ktor.utils.io.ExceptionUtilsJvmKt$createConstructor$$inlined$safeCtor$1.invoke(ExceptionUtilsJvm.kt:90)
    	at io.ktor.utils.io.ExceptionUtilsJvmKt.tryCopyException(ExceptionUtilsJvm.kt:66)
    	at io.ktor.utils.io.ByteBufferChannelKt.rethrowClosed(ByteBufferChannel.kt:2460)
    	at io.ktor.utils.io.ByteBufferChannelKt.access$rethrowClosed(ByteBufferChannel.kt:1)
    	at io.ktor.utils.io.ByteBufferChannel.setupStateForRead(ByteBufferChannel.kt:310)
    	at io.ktor.utils.io.ByteBufferChannel.readByte(ByteBufferChannel.kt:2540)
    	at com.example.TestKt.main(Test.kt:13) // Line with readByte()
    	at com.example.TestKt$main$2.invoke(Test.kt)
    	at com.example.TestKt$main$2.invoke(Test.kt)
    	at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:205)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
    	at kotlin.coroutines.jvm.internal.RunSuspendKt.runSuspend(RunSuspend.kt:19)
    	at com.example.TestKt.main(Test.kt)
    Caused by: java.lang.IllegalStateException: Handler for READ is already registered
    	at io.ktor.network.selector.InterestSuspensionsMap.addSuspension(InterestSuspensionsMap.kt:34)
    	at io.ktor.network.selector.SelectorManagerSupport.select(SelectorManagerSupport.kt:40)
    	at io.ktor.network.sockets.CIOReaderKt$attachForReadingImpl$1.invokeSuspend(CIOReader.kt:46)
    	at io.ktor.network.sockets.CIOReaderKt$attachForReadingImpl$1.invoke(CIOReader.kt)
    	at io.ktor.network.sockets.CIOReaderKt$attachForReadingImpl$1.invoke(CIOReader.kt)
    	at io.ktor.utils.io.CoroutinesKt$launchChannel$job$1.invokeSuspend(Coroutines.kt:132)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:367)
    	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
    	at kotlinx.coroutines.BuildersKt__Builders_commonKt.startCoroutineImpl(Builders.common.kt:192)
    	at kotlinx.coroutines.BuildersKt.startCoroutineImpl(Unknown Source)
    	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:134)
    	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
    	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
    	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
    	at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
    	at io.ktor.utils.io.CoroutinesKt.launchChannel(Coroutines.kt:123)
    	at io.ktor.utils.io.CoroutinesKt.writer(Coroutines.kt:77)
    	at io.ktor.network.sockets.CIOReaderKt.attachForReadingImpl(CIOReader.kt:27)
    	at io.ktor.network.sockets.NIOSocketImpl$attachForReading$1.invoke(NIOSocketImpl.kt:43)
    	at io.ktor.network.sockets.NIOSocketImpl$attachForReading$1.invoke(NIOSocketImpl.kt:41)
    	at io.ktor.network.sockets.NIOSocketImpl.attachFor(NIOSocketImpl.kt:80)
    	at io.ktor.network.sockets.NIOSocketImpl.attachForReading(NIOSocketImpl.kt:41)
    	at io.ktor.network.sockets.SocketsKt.openReadChannel(Sockets.kt:108)
    	at com.example.TestKt.main(Test.kt:11) // Line with .openReadChannel()
    	... 7 more
    Edit: The only dependency I have n the example project is ktor-network:1.6.6
    a
    • 2
    • 2
  • p

    phldavies

    12/02/2021, 12:38 PM
    It’s probably been asked before, but is there a reason why
    MockEngine.create
    doesn’t return
    MockEngine
    ? At the moment we’re doing
    MockEngine.create { … } as MockEngine
    - will it be expected in the future that
    MockEngine.create
    might not return
    MockEngine
    ?
    a
    • 2
    • 2
  • m

    martmists

    12/02/2021, 4:50 PM
    Is there a way to disable ktor server from logging common errors? e.g. cancelling a download: https://www.toptal.com/developers/hastebin/noqucizoku.log
    a
    • 2
    • 3
  • m

    maxmello

    12/03/2021, 11:06 AM
    On Android, I’m using
    io.ktor:ktor-client-okhttp
    but need to support Android 4.2+, so I included OkHttp in version
    3.12.0
    as documented by OkHttp to support Android 4. Will bis cause problems when using Ktor together with OkHttp? Is compatibility between versions documented somewhere?
    a
    • 2
    • 3
  • m

    martmists

    12/03/2021, 1:22 PM
    a(...) {
        attributes["download"] = "..."
    }
    is what you're looking for I think
    🧵 2
    👀 1
    a
    a
    • 3
    • 6
  • a

    Alexandre Brown

    12/04/2021, 3:35 PM
    Hello, does Ktor server support gRPC? I'm new to gRPC and would love to try it. Thanks
    h
    • 2
    • 1
  • s

    Slackbot

    12/05/2021, 4:01 PM
    This message was deleted.
    a
    • 2
    • 1
  • e

    Emirhan Emmez

    12/06/2021, 10:19 AM
    Hi, why am i getting 404 in test ?
    withTestApplication {
        handleRequest(HttpMethod.Get, "/hello").apply {
            assertEquals(HttpStatusCode.OK, response.status())
        }
    }
    a
    • 2
    • 12
  • a

    Alex Styl

    12/06/2021, 12:18 PM
    I do not think I understand
    StatusPages
    plugin correctly. I am trying to redirect the user to “/” if they try to navigate to a page that does not exist (say they go to “/invalid”, then the browser should redirect to “/” instead). I was under the impression that I would have to use StatusPages for this like so:
    install(StatusPages) {
            status(HttpStatusCode.NotFound) {
                call.respondRedirect("/")
            }
    but when I navigate to “/invalid” the browser displays a blank page and the console shows a 404 for “/invalid”. I set a breakpoint to the call but it is never triggered. Isn’t this what StatusPages are meant to handle? Would I need to use something else for this scenario? (I am thinking that maybe i could use just routing with wildcards)
    k
    • 2
    • 3
  • t

    Trevor Stone

    12/06/2021, 10:27 PM
    Is there any roadmap for ktor to own certificate pinning for the client?
    ➕ 1
    a
    • 2
    • 1
  • l

    Landry Norris

    12/06/2021, 10:58 PM
    Has a general timeframe been announced for the 2.0 release? I found this ticket https://youtrack.jetbrains.com/issue/KTOR-3457, but there isn't any indication of general timeline that I can see. The native mode looks cool, and would work really well with a project I'm planning on starting in the future.
    a
    h
    • 3
    • 2
  • r

    Raymond Boswel

    12/07/2021, 7:16 AM
    I have a RouteBuilder object that dynamically configures all the routes for my application, given a list of controller classes. However, when I run the project without the gradle shadow plugin, the object doesn't seem to cross into the embeddedServer context. The relevant code snippet and resulting log output is pasted below:
    <http://log.info|log.info>("RouteTypeMap size: ")
    		<http://log.info|log.info>(RouteBuilder.routeTypeMap.size.toString())
    
    		embeddedServer(
    				Netty
    			, port = 11111
    		) {
    			<http://log.info|log.info>("RouteTypeMap size in configuration block: ")
    			<http://log.info|log.info>(RouteBuilder.routeTypeMap.size.toString())
    Log:
    RouteTypeMap size:
    870
    RouteTypeMap size in configuration block:
    0
    My knowledge of kotlin isn't deep enough to really have a a clue as to why this is happening 😅
    a
    e
    • 3
    • 14
  • e

    Emirhan Emmez

    12/07/2021, 10:27 AM
    Hi guys, i want to setBody to handleRequest for test. How should i do?
    handleRequest(<http://HttpMethod.Post|HttpMethod.Post>, "/login") {
        addHeader(HttpHeaders.ContentType, ContentType.Application.Json.toString())
        addHeader(HttpHeaders.Accept, ContentType.Application.Json.toString())
        //setBody("{\"username\": \"emirhan\", \"password\": \"1234\"}")
        setBody(listOf("username" to "emirhan", "password" to "1234").toString())
    }
    i'm receiving: io.ktor.features.CannotTransformContentToTypeException: Cannot transform this request's content to com.emirhan.model.UserRequest My data class UserRequest is like:
    @Serializable
    data class UserRequest(
        val username: String,
        var password: String
    )
    In route im receiving body like:
    val userRequest = call.receive<UserRequest>()
    h
    • 2
    • 22
  • j

    Júlio Santos

    12/07/2021, 7:10 PM
    Talk about guys! Do you happen to have any material on the differences between Spring and Ktor? Please
    c
    • 2
    • 10
  • p

    Peter

    12/08/2021, 4:16 PM
    what’s the canonical way to create a URL string literal with encoded parameters?
    a
    • 2
    • 3
  • a

    Alex Styl

    12/08/2021, 6:56 PM
    I am facing a very strange behaviour with a download button and a video. I am not sure how to debug this so any help is welcome. I have a page with a href and a video (see the routing setup below). If the anchor is the only tag in the page clicking on it, then the file starts downloading, no problem here. When I have both the anchor tag and the video tag, clicking on the anchor doesn’t trigger the download… I also noticed that it will eventually start downloading, only if I click on the video 🤯
    fun Application.configureRouting() {
        routing {
            static("/vid") {
                files("videos")
            }
            get("/download/*") {
                val file = File("./files/hello.txt")
                call.respondFile(file)
            }
            get("/") {
                call.respondHtml {
                    body {
                        a(href = "/download/hello.txt") {
                            attributes["download"] = ""
                            +"Download"
                        }
                        video {
                            loop = true
                            controls = true
                            source {
                                src = "/vid/vid.mp4"
                                type = "video/mp4"
                            }
                        }
                    }
                }
            }
        }
    }
    a
    • 2
    • 2
  • a

    Alex Styl

    12/09/2021, 1:19 PM
    What is the css DSL counter part of the following css?
    @font-face {
        src: url("/fonts/Urbanist.ttf");
        font-family: urbanist;
    }
    So far I got:
    call.respondCss {
        fontFace {
            fontFamily = "urbanist"
        }
    }
    but I cannot find a way to populate the src value. (also, please let me know if this is not the right place to ask this)
    m
    a
    • 3
    • 5
  • s

    smallshen

    12/10/2021, 4:19 AM
    message has been deleted
    h
    • 2
    • 1
  • v

    Vasily Scherbakov

    12/10/2021, 8:13 PM
    hi guys! can anyone can help me with multipart form data? i have a ktor server endpoint which expects a two parts form data: form item and form data. I can send form item without any problems, but a cant findout a way to send file as PartData.FileItem thx
    c
    a
    • 3
    • 5
  • a

    Alex Styl

    12/11/2021, 4:25 PM
    How can I check the size of an uploaded file to ktor? Checked the documentation and searched here but surprised I couldn’t find something
    c
    a
    • 3
    • 5
  • t

    Thomas

    12/11/2021, 5:16 PM
    I am using version 2.0.0-eap-278. It looks like
    defaultRequest
    was moved from features package to plugins package. However, now
    attributes
    in the
    defaultRequest
    block is unresolved. I think this is a bug as it was there previously. How to fix this?
    a
    r
    • 3
    • 3
  • t

    Tomasz Krakowiak

    12/12/2021, 1:09 PM
    I noticed that on https://ktor.io/learn/ Server-Sent Events are referred as Server-Side Events. I guess that's a typo.
    a
    • 2
    • 2
  • d

    Damiano Giusti

    12/13/2021, 2:34 PM
    Hi, is there a way to use Ktor 1.6.7 with Coroutines 1.6.0-RC2 on Kotlin/Native to take advantage of the new memory model? I get an error when I try to use the HttpClient on iOS, which is thrown by this function which is called in the init block of HttpClient. Looks like I’m not able to use a Coroutines version different than a
    native-mt
    one
    h
    r
    j
    • 4
    • 7
  • f

    FunkyMuse

    12/14/2021, 7:39 AM
    Hello everyone, is there a guide on microservices for ktor or a sample project one can look at, preferably ktor 2.0 EAP?
    a
    j
    • 3
    • 5
  • a

    Alex Styl

    12/14/2021, 10:59 AM
    I installed an SSL certificate on my ktor server (Let’s Encrypt) and the HttpsRedirect to automatically switch to https calls instead of http. Is there a way to hide the port number from the url without having to use a reverse proxy?
    a
    • 2
    • 4
  • n

    Nabil

    12/14/2021, 1:45 PM
    Hi 👋 was libcurl for Apple Silicon released? I can only find macos
    x86_64
    but not macos
    arm64
    https://mvnrepository.com/artifact/io.ktor/ktor-client-curl-macosx64 ✅ https://mvnrepository.com/artifact/io.ktor/ktor-client-curl-macosarm64 ❌ For the context: we use libcurl as a Ktor client engine for macos in Realm-Kotlin and we're in the process of adding support for
    macosArm64
    j
    h
    • 3
    • 5
  • m

    Mark Alvaro

    12/15/2021, 12:59 AM
    Hello there! A project I work on maintains multiple HTTP client-backed services for Java, JavaScript, Kotlin, and Swift that all basically do the same thing, so Ktor’s multiplatform support looks super attractive for reducing a lot of duplication and maintenance burdens. I made a simple service using Ktor that calls a GET method, and noticed my function needed to become a suspend function (or maybe wrap the call with
    runBlocking
    , but I doubt that’s a performant or even suggested approach, and it won’t work for JS or common). As far as working with the service using Kotlin goes, whether in my common, JVM, JS, or whatever source set, I had no issues. The problem I have is consuming the service from Java code of course adds the Continuation argument, which isn’t something I want to impose on consumers of these services. I’ve seen a few threads in this channel about this issue, but I’m still wondering if there is any documentation or examples on how to make consuming the suspend function from Java sources more friendly. I saw mention of transforming to Futures or RxJava Singles or some other equivalent type, which is totally fine, but I’m not sure where to look for examples on how to even achieve that. I also know I can create a JVM-specific implementation that uses
    runBlocking
    , but again I’m pretty sure that should be avoided. Am I correct that using
    runBlocking
    would actually be worse than making the service using a RestEasy blocking client, due to coroutines not wanting to be blocked? Or would the performance be similar to a traditional blocking client, and I’d just be giving up benefits from using coroutines? Any pointers or links to guides would be appreciated!
    b
    • 2
    • 4
  • b

    Bruno Medeiros

    12/15/2021, 1:57 AM
    playing with ktor 2 eap, I’m confused with 2 things: • Why is the latest version for
    ktor-server-core-macosx64
    2.0.0-eap-272
    instead of
    2.0.0-eap-283
    ? Are we having any problems with the building mechanism, or is this discontinued? • How can I install
    ktor-server-content-negotiation
    ? I can’t see this published for any platform, but without it I don’t know how to install the json serializer
    a
    e
    r
    • 4
    • 8
Powered by Linen
Title
b

Bruno Medeiros

12/15/2021, 1:57 AM
playing with ktor 2 eap, I’m confused with 2 things: • Why is the latest version for
ktor-server-core-macosx64
2.0.0-eap-272
instead of
2.0.0-eap-283
? Are we having any problems with the building mechanism, or is this discontinued? • How can I install
ktor-server-content-negotiation
? I can’t see this published for any platform, but without it I don’t know how to install the json serializer
a

Aleksei Tirman [JB]

12/15/2021, 7:19 AM
Why is the latest version for 
ktor-server-core-macosx64
 
2.0.0-eap-272
 instead of 
2.0.0-eap-283
? Are we having any problems with the building mechanism, or is this discontinued?
@e5l
How can I install 
ktor-server-content-negotiation
? I can’t see this published for any platform, but without it I don’t know how to install the json serializer
It's available for the JVM. You can use
io.ktor:ktor-server-content-negotiation:$ktorVersion
and
io.ktor:ktor-serialization-kotlinx-json:$ktorVersion
artifacts. Please read the docs for more information.
👀 1
b

Bruno Medeiros

12/15/2021, 7:22 AM
I know it's available for JVM, but I'm trying to set up a purely native server.
(sorry, I meant any "any native platform")
a

Aleksei Tirman [JB]

12/15/2021, 10:30 AM
Unfortunately, the ContentNegotiation plugin isn't implemented for native platforms yet.
b

Bruno Medeiros

12/15/2021, 10:31 AM
are PRs being accepted for that?
e

e5l

12/15/2021, 10:49 AM
Yep, we will merge the PR before 2.0.0-beta release in this year
b

Bruno Medeiros

12/15/2021, 10:49 AM
I'll give it a try this weekend, I'll let you know
r

Rustam Siniukov

12/15/2021, 2:01 PM
There is a PR that migrates all plugins, that can be migrated. https://github.com/ktorio/ktor/pull/2725
View count: 6