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
  • s

    serebit

    12/27/2018, 1:43 PM
    With ktor-client 1.1.0 and 1.1.1 in a multiplatform project, the package io.ktor is unresolved, both in the base gradle build and in IntelliJ.
    ✅ 1
    c
    • 2
    • 20
  • d

    david.bilik

    12/28/2018, 8:32 AM
    Hello, I have a weird problem with
    HttpClient
    class in IntelliJ Idea .. it is marked in red like if it was an error, but all compiles ok and intellisense works too. any ideas? 😕 I am using gradle
    ✅ 1
    e
    g
    c
    • 4
    • 15
  • s

    spierce7

    12/28/2018, 4:40 PM
    Should I be using kotlinx.serialization for server side serialization / deserialization? I'm not seeing a kotlinx.serialization
    ContentNegotiation
    feature for kotlinx.serialization. Has anyone benchmarked it against jackson?
    g
    • 2
    • 4
  • c

    christophsturm

    12/28/2018, 5:07 PM
    can i use the test host directly without using
    withTestApplication
    ?
    m
    • 2
    • 5
  • s

    spierce7

    12/28/2018, 10:32 PM
    The ktor documentation mentions not using
    watchPaths
    for production for performance reasons. Is there a flag to indicate production use, or do I need to provide an if block, and provide an empty list for
    watchPaths
    in production?
    c
    • 2
    • 3
  • r

    Robert Menke

    12/29/2018, 6:45 PM
    Hey there, I’m a bit new to the world of running JVM apps on the server. I’m setting up a docker-compose.yml file and was looking around for a standardized directory to mount my volume in the linux container. For example PHP: uses
    /var/www/html
    Node: uses
    /var/app
    is there a standard or recommended practice for ktor apps?
    n
    • 2
    • 1
  • b

    bdawg.io

    12/29/2018, 10:10 PM
    I’ve never understood why applications don’t use the
    /srv
    directory defined by the FHS (Filesystem Hierarchy Standard) since 2004 which most Linux distros follow
    /srv
    contains site-specific data which is served by this system.
    n
    o
    • 3
    • 11
  • b

    bod

    12/30/2018, 2:52 PM
    Hi! I'm using ktor on Android to server a simple webpage. It works... except in release mode (with proguard enabled) only part of the file is served, and then I see an exception in the logs. After googling a bit, I've tried to add some proguard rules, but it didn't change anything. Also the stacktrace is very cryptic (see thread below).
    🤓 1
    l
    • 2
    • 6
  • o

    orangy

    12/30/2018, 10:16 PM
    📣 Kotlin (and ktor) team went on New Year holidays, which are somewhat long here. We will get back to work Jan, 9. I hope that people can help each other here as much as possible 🙂
    👍 5
    🎉 2
    s
    • 2
    • 2
  • m

    miha-x64

    12/31/2018, 1:10 PM
    Also, from auth examples
    authentication {
        basic/digest("someName") { ... }
    }
    ...
    authenticate("someName")
    why on earth not use static typing and symbol resolving? For instance:
    val someAuth = basicAuth { ... }
    ...
    authenticate(someAuth) { ... }
    o
    • 2
    • 2
  • p

    poohbar

    12/31/2018, 8:14 PM
    anybody know what origins are enabled by default when one does
    install(CORS)
    ?
    b
    • 2
    • 2
  • r

    Ramin

    01/01/2019, 4:48 PM
    hey guys, I'm gonna continue my last thread some how about how structure a backend (REST api) application with ktor or let's say with kotlin. I tried to read kotlin conf backend and I see a normal php application is much more organized and structured than what I can see in KotlinConf app. the question is how do you feel about it. is there anybody in here who is going to develop a complete application with ktor or kotlin? to me it seems ktor needs a boilerplate or something to be more structured with a comprehensive web application
    b
    s
    +2
    • 5
    • 19
  • s

    serebit

    01/01/2019, 8:47 PM
    How would I go about streaming an octet-stream to a file with ktor-client-okhttp?
    d
    • 2
    • 1
  • g

    gotoOla

    01/02/2019, 7:09 AM
    Anybody knows how you can still accept content-type text/plain after installing content negotiation with jackson? Right now I have
    install(ContentNegotiation) {
                jackson {
    
                }
    }
    but then I get unsupported media type when posting with text/plain. Would like to support both of these formats as default …my google wizardry is starting to drain 😞
    t
    o
    • 3
    • 5
  • d

    dalexander

    01/02/2019, 5:39 PM
    I’m running in to some unexpected behavior with ktor-client where I make a request that receives a couple of 302 redirections, some of which set cookies. However the cookies are not being set which leads to the final request failing because it needs the cookies. When setting breakpoints it only appears as though the HttpCookies client-feature is only updating cookies when the final response is received rather than also on the redirections. Is this intended behavior? If so is there an easy way to tell the cookies feature to update on redirects? I’m using the okhttp engine in case it’s relevant.
    o
    • 2
    • 4
  • p

    pandawarrior

    01/03/2019, 10:34 AM
    I tried to upload an image to the server with ktor-client. But it lacks
    Content-Length
    . May I know how can I put it in please?
    -.kt
    j
    • 2
    • 5
  • a

    amt

    01/04/2019, 1:46 AM
    When can we expect a production usable version of the Coroutine IO client for Postgres? I see only the shell at https://github.com/ktorio/ktor-clients. Is this project not being developed any more?
    o
    • 2
    • 3
  • g

    gotoOla

    01/04/2019, 12:37 PM
    a questino about https://ktor.io/servers/deploy/packing/fatjar.html - Is it really necessary to apply the plugin ‘application’ when you are building a fat jar?
    • 1
    • 1
  • b

    bjonnh

    01/04/2019, 9:07 PM
    What would be a recommended way of handling that (client side)
    e
    • 2
    • 3
  • o

    orangy

    01/05/2019, 3:26 PM
    We would be happy to fix it, if you have any idea
    m
    • 2
    • 1
  • q

    qlitzler

    01/05/2019, 3:53 PM
    Could we have a ktor eap release with kotlin 1.3.20-eap ? Would be so helpful 🙏
    j
    • 2
    • 2
  • r

    rocketraman

    01/05/2019, 5:14 PM
    I'm trying to use a local copy of https://github.com/ktorio/ktor/blob/master/ktor-server/ktor-server-core/jvm/src/io/ktor/http/content/OutputStreamContent.kt in ktor CIO client code. However, my client often freezes when writing to the
    OutputStream
    , with the stack:
    "DefaultDispatcher-worker-5@10353" daemon prio=5 tid=0x69 nid=NA waiting
      java.lang.Thread.State: WAITING
    	  at sun.misc.Unsafe.park(Unsafe.java:-1)
    	  at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:338)
    	  at kotlinx.coroutines.io.jvm.javaio.BlockingAdapter.parkingLoop(Blocking.kt:235)
    	  at kotlinx.coroutines.io.jvm.javaio.BlockingAdapter.submitAndAwait(Blocking.kt:215)
    	  at kotlinx.coroutines.io.jvm.javaio.BlockingAdapter.submitAndAwait(Blocking.kt:186)
    	  at kotlinx.coroutines.io.jvm.javaio.OutputAdapter.write(Blocking.kt:108)
    	  - locked <merged>(a kotlinx.coroutines.io.jvm.javaio.OutputAdapter)
    	  at java.io.OutputStream.write(OutputStream.java:75)
    	  at [...code that writes to OutputStream...]
    	  at io.ktor.client.engine.cio.UtilsKt.write(utils.kt:55)
    	  at io.ktor.client.engine.cio.Endpoint$makeDedicatedRequest$1.invokeSuspend(Endpoint.kt:108)
              [...]
    My call to
    OutputStream
    for testing is simply
    write(bytes)
    where bytes is a
    ByteArray
    .
    • 1
    • 1
  • m

    miha-x64

    01/05/2019, 6:01 PM
    A bit stuck with OAuth. Even with
    error
    in URL getting infinitely redirected to OAuth provider and back. What am I doing wrong?
    Untitled.kt
    • 1
    • 1
  • s

    sngrekov

    01/06/2019, 3:17 PM
    Hi! I'am trying to use io.ktor:ktor-client-logging on multiplatform project, and it fails to build. On ./gradlew clean android:app:installLocalDebug it shows KotlinConfApi.kt: (6, 40): Unresolved reference: DEFAULT KotlinConfApi.kt: (7, 40): Unresolved reference: LogLevel KotlinConfApi.kt: (8, 40): Unresolved reference: Logger KotlinConfApi.kt: (9, 40): Unresolved reference: Logging But in IJ imports are ok I got KotlinConf sample and added dependency as shown on https://ktor.io/clients/http-client/features/logging.html
    o
    • 2
    • 7
  • d

    Dominaezzz

    01/06/2019, 6:22 PM
    When is
    ktor-client-curl
    going to be published?
    e
    • 2
    • 1
  • v

    Vinicius Carvalho

    01/07/2019, 5:20 PM
    Hi all is there a way to use some sort of alias for
    @Location
    query parameters?
    s
    • 2
    • 1
  • d

    dave08

    01/08/2019, 11:39 AM
    Gradle deps:
    //ktor-client
    	implementation "io.ktor:ktor-client-core:$ktor_version"
    	implementation "io.ktor:ktor-client-apache:$ktor_version"
    	implementation "io.ktor:ktor-client-json:$ktor_version"
        testCompile "io.ktor:ktor-server-test-host:$ktor_version"
    s
    s
    • 3
    • 3
  • d

    dave08

    01/08/2019, 12:25 PM
    @e5l The docs don't indicate anything different... https://ktor.io/clients/http-client/features/json-feature.html, where are the new dependencies?
    e
    r
    • 3
    • 5
  • f

    fkrauthan

    01/09/2019, 8:33 PM
    What is the recommended ktor way of returning different set of data depending on who is logged in? E.g. when requesting a user object if I am the owner of it to return everything and when I am not the owner to just return some information. In the past I would have used JSON Views (I use Jackson) but I don't think there is currently a way to use JSON Views with ktor
    t
    a
    • 3
    • 14
  • w

    wilyarti

    01/10/2019, 8:23 AM
    Does anyone have a html to Kotlin converter (kotlinx)? I want to use the DSL but it is painful to convert it by hand.
    o
    • 2
    • 1
Powered by Linen
Title
w

wilyarti

01/10/2019, 8:23 AM
Does anyone have a html to Kotlin converter (kotlinx)? I want to use the DSL but it is painful to convert it by hand.
o

orangy

01/10/2019, 8:29 AM
There was a dedicated plugin for this in IDEA’s plugin repository, but I’m not sure if it’s up to date
👍 1
View count: 7