Tim Malseed
01/17/2020, 1:36 PMmantono
01/18/2020, 5:30 PMaccess_token
in ktor? I cannot seem to find a function that does it for me 🤔 At least not on call.request
....Martins Joseph
01/18/2020, 9:20 PMnrobi
01/21/2020, 7:45 AMUnable to resolve dependency for ':common@debug/compileClasspath': Could not resolve io.ktor:ktor-client-ios:1.3.0.
gotoOla
01/21/2020, 9:14 AMbitkid
01/21/2020, 10:16 AMjk2018
01/22/2020, 9:51 PMAlexander Weickmann
01/22/2020, 10:10 PMbitkid
01/23/2020, 9:28 AMpart.streamProvider().reader() // do some stuff with the reader
but it's not ok to do
GZIPInputStream(part.streamProvider().buffered()).reader()
my expectation was that wrapping a stream should not be blocking or?hdarritchon
01/24/2020, 2:41 PMjava.lang.UnsupportedOperationException: Headers can no longer be set because response was already completed
. I suppose it’s too late. So I was wandering if it is possible to have a phase where the Request is processed, the response is ready but I’m still able to modify the response to add some headers.Leon K
01/24/2020, 4:33 PMsnowe
01/25/2020, 3:51 AMApache
? It doesn't seem to want to accept Tomcat
, but I don't want to run two applications servers just to use oauth.Rodrigo Silva
01/25/2020, 5:50 PMinstall(ContentNegotiation) {
jackson {
registerModule(JodaModule())
dateFormat = DateFormat.getDateInstance(3)
enable(SerializationFeature.INDENT_OUTPUT)
}
}
but my json was like:
"date": {
"year": 2020,
"month": "JANUARY",
"monthValue": 1,
"dayOfMonth": 25,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
},
And what I wanted
"date": "2020/01/25"
cesards
01/27/2020, 4:39 AM<servlet-class>io.ktor.server.servlet.ServletApplicationEngine</servlet-class>
and I think the Driver used by Cloud PostgreSQL might be different than the one needed? I’m not sure if what I’m saying makes sense but I’m getting crazy trying to make this work.
Has anyone deployed Ktor on Google Cloud that also connects to an external database?
Is it recommended? I guess the other alternative is using h2 and have a local database, but then looking at data I guess it becomes more complicated, doesn’t it?
I’m quite new to the backend world, so any suggestions are more than appreciated.cy
01/27/2020, 9:55 AMHttpSend.intercept
function? We are going to break it's signature (only source compatibility, not binary) in 1.3.1 so want to know if anybody cares?gotoOla
01/27/2020, 1:40 PMprivate fun createMockedHttpClient(): HttpClient {
return HttpClient(MockEngine) {
engine {
addHandler { request ->
respond("hej")
}
}
}
}
and then I try to coVerify (a function from mockk) that calls were made towards the mock
coVerify(exactly = 10) { <http://httpClient.post|httpClient.post>("<http://localhost:8081>") }
but what I get is
Missing calls inside verify { ... } block.
Kris Wong
01/27/2020, 2:15 PMHttpClient
with LogLevel.ALL
, and it only seems to log requests, not responses, which doesn't make sense to me. is that the intended behavior?Kris Wong
01/27/2020, 4:02 PMHttpResponse.readText
is causing an exception with K/N: mutation attempt of frozen kotlin.collections.HashMap@3253bdb8bitkid
01/27/2020, 4:14 PMcall.respondTextWriter
together with http content compression? so basically that it writes back a chunked gzip stream.Luke Rohde
01/27/2020, 6:59 PMsnowe
01/27/2020, 9:26 PMauthenticate {}
, it doesn't redirect me to the login page. I can't find any resources that indicate how you're supposed to accomplish this though.fcosta
01/27/2020, 10:46 PMDario Pellegrini
01/28/2020, 11:48 AMsonofblip
01/28/2020, 5:40 PMKris Wong
01/28/2020, 7:24 PMTestEngine
doesn't handle any HTTP. i'd like to have a super simple/lightweight embedded server for test purposes, to test my platform-specific HTTP clients. is there a recommended way to do this?Cristián Arenas
01/28/2020, 11:41 PMwithTimeout
function, but all hell broke loose. 😅MrPowerGamerBR
01/29/2020, 2:19 AMgotoOla
01/29/2020, 9:03 AMmockEngineConfig.addHandler { request ->
respondOk()
}
ktorMockEngine = MockEngine(mockEngineConfig)
val httpClient = HttpClient(ktorMockEngine)
// fire off 10 concurrent requests, ackording to the logs all of them are sent but I end up with
Assertions.assertThat(ktorMockEngine.requestHistory.size).isEqualTo(10)
Expecting:
<8>
to be equal to:
<10>
Sourabh Rawat
01/29/2020, 6:30 PMxcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
while running gradle clean check.
What am I missing? I want to run tests in ktor-client-tests
.Yyq2008
01/30/2020, 9:29 AMpost("/oauth/token") {
val gt = call.parameters.get("grant_type") ?: call.respond(HttpStatusCode.BadRequest, mapOf("error" to "no grant_type specified"));
call.respondText(call.request.headers["Authorization"] ?: "No header")
}
how to response and return to avoid run the second response?Yyq2008
01/30/2020, 9:29 AMpost("/oauth/token") {
val gt = call.parameters.get("grant_type") ?: call.respond(HttpStatusCode.BadRequest, mapOf("error" to "no grant_type specified"));
call.respondText(call.request.headers["Authorization"] ?: "No header")
}
how to response and return to avoid run the second response?spand
01/30/2020, 10:44 AMpost("/oauth/token") {
param("grant_type") {
handle {
val gt = call.parameters.get("grant_type")!! call.respond(HttpStatusCode.BadRequest, mapOf("error" to "no grant_type specified"));
call.respondText(call.request.headers["Authorization"] ?: "No header")
}
}
}
Yyq2008
01/30/2020, 12:27 PMpost("/oauth/token") {
val gt = call.parameters.get("grant_type") ?: run {
call.respond(
HttpStatusCode.BadRequest,
mapOf("error" to "no grant_type specified")
);
return@post
}
call.respondText(call.request.headers["Authorization"] ?: "No header")
}
Dico
01/31/2020, 10:52 AMif (gt == null) {...}
?Yyq2008
02/15/2020, 5:26 AM