https://kotlinlang.org logo
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
  • m

    Muthu Nadar

    01/16/2018, 1:57 PM
    Also, is Ktor production ready?
    o
    • 2
    • 1
  • n

    noncom

    01/17/2018, 9:35 AM
    I get his: https://gist.github.com/noncom/ab3a3ea035dd81556ccbd5851473ed39 when the Ktor server is down, and there is a page in the browser that is trying to load from it (in the example it is trying to load the
    "/"
    page), and I turn the server on
    o
    • 2
    • 1
  • w

    wouterdoeland

    01/17/2018, 3:50 PM
    Hi! How do I use HTTPS with Ktor?
    c
    • 2
    • 11
  • a

    aeruhxi

    01/17/2018, 4:34 PM
    Hi, how do I ignore some fields of model class when serializing to json with gson?
    w
    a
    • 3
    • 20
  • x

    xxxifan

    01/18/2018, 3:16 PM
    Hi guys, how can I output http request to console? Is there a convenient way to do it?
    c
    • 2
    • 3
  • w

    wouterdoeland

    01/19/2018, 4:33 PM
    I want to test my Ktor application, but for many requests I need to set some part of the post request body, how should I go about that? For example if I want to set the
    data
    post parameter, should I just use it like this:
    with(handleRequest(<http://HttpMethod.Post|HttpMethod.Post>, path, {
                body = "data=$data"
            })) {
                // test body
            }
    c
    • 2
    • 1
  • n

    noncom

    01/19/2018, 8:54 PM
    I want to close it explicitly when it is no longer needed
    m
    • 2
    • 13
  • m

    miha-x64

    01/20/2018, 1:39 PM
    I like Rapidoid at this point. It has both high-level and highly-performant APIs.
    o
    • 2
    • 3
  • d

    damian

    01/20/2018, 10:52 PM
    hm. i assumed that with gson content negotiation it'd still be able to map it to a
    ValuesMap
    but maybe thats not the case
    o
    • 2
    • 3
  • k

    kielpedia

    01/21/2018, 1:53 AM
    I have a ktor question if anyone is willing to help. Having trouble using
    withTestApplication
    in my unit test because I am using a system property in my App like
    val property = environment.config.property("randomproperty").getString()
    n
    • 2
    • 2
  • k

    kristofdho

    01/23/2018, 6:53 PM
    save the valuesmap locally?
    w
    • 2
    • 1
  • o

    orangy

    01/23/2018, 9:46 PM
    One option that just came into my mind is an CN-interceptor.
    install(ContentNegotiation) {
       …
       intercept<Parameters> {
          // called when instance of Parameters is being sent (before transform) or received (after transform)
       }
       intercept<Entity> {
       // called when instance of Entity (or derived) is being processed
       }
       intercept<Any> {
       // any instance, called if more specific type interceptor is not found. Or may be call all matching interceptors
       }
    }
    👍 1
    • 1
    • 1
  • m

    mkporwit

    01/25/2018, 3:51 AM
    It wasn't hard to add
    suspend inline fun <reified T> <http://HttpClient.post|HttpClient.post>(builder: HttpRequestBuilder): T {
            builder.method = <http://HttpMethod.Post|HttpMethod.Post>
            return request(builder)
        }
    as an extension function to get
    <http://HttpClient.post|HttpClient.post>
    , but still, seems a little inconsistent...
    👍 1
    e
    • 2
    • 1
  • o

    orangy

    01/25/2018, 8:45 PM
    Does it work with
    gradle clean test
    ?
    l
    • 2
    • 4
  • l

    leus

    01/26/2018, 2:02 PM
    Is it possible to use Locations with POST?
    s
    k
    • 3
    • 18
  • d

    deviant

    01/28/2018, 1:42 PM
    yes, but you can
    suspend
    😉
    d
    • 2
    • 1
  • q

    qwert_ukg

    01/29/2018, 3:47 AM
    Could somebody show structure of Ktor app? I mean files and packages structure, where did u put your client code and where is system? I was never seen pipeline app before, only MVC as system part and service layer as client part. In Ktor samples have no too. Thanks
    👍 1
    a
    c
    • 3
    • 3
  • q

    qwert_ukg

    01/29/2018, 3:51 AM
    now i have a package with my interceptors only 🙂
    c
    • 2
    • 3
  • a

    avolkmann

    01/29/2018, 2:47 PM
    I think someone already mentioned it, but my host tests broke when upgrading from 0.9.0 to a more recent version
    c
    • 2
    • 2
  • g

    gotwalt

    01/29/2018, 9:08 PM
    is there a simple demo of getting quasi-normal http logging out of ktor?
    o
    s
    • 3
    • 58
  • n

    neil

    01/29/2018, 10:07 PM
    is there any guide to running ktor with gradle in the commandline?
    t
    c
    • 3
    • 3
  • d

    Deactivated User

    01/29/2018, 10:30 PM
    I was thinking about caching html content so instead of generating the whole dom, I could cache a complete chunk and to store it in-memory or in redis. Reducing garbage generated/cycles used per request. This was my approach: https://github.com/soywiz/ktor-steps/commit/36d83471e4554ab19eae6aef3ec104093d4a6b7f Is there already an official way for doing this? Also it is possible to mix suspend things when constructing the dom, so I can for example grab something from a database inside a “cache” chunk and do that just once?
    o
    • 2
    • 2
  • x

    xxxifan

    01/31/2018, 1:22 AM
    Thanks you, this is working. And I just found it's almost the same with my previous code```call.resolveResource("index.html", "web")?.let { call.respond(it) }```, I'd say it's inspired from those source code, but these method name confused me a lot 😛
    c
    • 2
    • 1
  • g

    gildor

    01/31/2018, 1:16 PM
    Whoa it’s so great! Welcome Carlos! Will you work on docs for other JB projects too? Or especially for Kotlin?
    d
    • 2
    • 1
  • j

    jaaso

    01/31/2018, 1:54 PM
    https://github.com/goreRatzete/realworld-kotlin-ktor
    c
    • 2
    • 2
  • h

    hallvard

    01/31/2018, 2:15 PM
    That will be very welcome!
    👍 3
    t
    • 2
    • 1
  • x

    xxxifan

    01/31/2018, 3:27 PM
    created a pull request for Compression feature always returning Transfer-Encoding: chunked https://github.com/ktorio/ktor/pull/309
    o
    • 2
    • 1
  • a

    aeruhxi

    02/01/2018, 10:21 AM
    How do I use
    io.ktor.application.call
    in my custom function without parametrizing it?
    c
    e
    • 3
    • 9
  • m

    martsina

    02/01/2018, 8:09 PM
    Guys, could you help me: is 2.3.20 minimal version of freemarker for ktor? https://github.com/ktorio/ktor/blob/master/ktor-features/ktor-freemarker/build.gradle
    c
    h
    • 3
    • 2
  • x

    xxxifan

    02/04/2018, 3:22 AM
    what is the difference between files and resources?
    o
    • 2
    • 1
Powered by Linen
Title
x

xxxifan

02/04/2018, 3:22 AM
what is the difference between files and resources?
o

orangy

02/04/2018, 10:04 AM
Files are retrieved directly from the file system, but you have to know the path. Resources are using Java’s resource streams, like reading from JAR/WAR, etc. Otherwise they are the same.
👍 1
View count: 2