Simply2vasu
05/12/2020, 9:47 PM</test_domain/v2?key=test&per_page=5&page=2>; rel="next",</test_domain/v2?key=test&per_page=5&page=5>; rel="last"
with ktorgotoOla
05/13/2020, 9:13 AMJuan Rada
05/14/2020, 9:27 AMBenedict Pregler
05/14/2020, 9:49 AMrrva
05/14/2020, 9:50 AMrrva
05/14/2020, 9:51 AMJohn O'Reilly
05/14/2020, 9:53 AMbbaldino
05/14/2020, 6:42 PMuser/{userId}
and want to make sure all requests for a given userId
are handled in the order they were received. I've tried doing this in the route implement, but because there are multiple threads calling it there's still wiggle room as to the order in which they're handled: I know the network is already a variable, but I'm trying to get as close as possible to handling them in the order in which they were received. I looked at doing this in a feature, but even then the request is already dispatched to a worker thread so they've already been parallelized, is there a lower level hook? Or maybe this whole endeavor is misguided?napperley
05/14/2020, 11:53 PMmp
05/15/2020, 8:02 PMPhilipp Mayer
05/17/2020, 1:24 PMfun Application.adapter() {
val topic: SomeObject = SomeObject(environmnet.config.property("something").getString())
}
and I want to use the topic Object in a different class (a koin module).
I just have the feeling that I'm missing a fundamental concept here..
I just found that github issue, but that doesn't really help me.
https://github.com/ktorio/ktor/issues/1448bbaldino
05/18/2020, 4:42 AMktor-client-cio
client and creating a WebSocket
connection, if the HttpTimeout
feature is installed, it will apply to the WebSocket
connection, even if the connection is actively transmitting messages back and forth. It seems like WebSocket
should be considered an exception to HttpTimeout
? If not, is it possible to configure HttpTimeout
in a way that it could be applied to some requests (normal ones) but not things like a websocket connection?JoakimForslund
05/19/2020, 11:33 AMaleksey.tomin
05/19/2020, 1:53 PMnative
in .kts file
dependencies {
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-core-macosx64:$ktorVersion")
implementation("io.ktor:ktor-client-core-native:$ktorVersion")
implementation("io.ktor:ktor-client-curl:$ktorVersion")
implementation("io.ktor:ktor-http-cio:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-http-cio-native:$ktorVersion")
implementation("io.ktor:ktor-http-cio-macosx64:$ktorVersion")
}
It works with CUrl: client = HttpClient(io.ktor.client.engine.curl.Curl)
But doesn’t works with CIO: client = HttpClient(io.ktor.client.engine.cio.CIO)
> Task :compileKotlinMac FAILED
e: /.../CurlClient.kt: (12, 51): Unresolved reference: cio
What have I to do?Sabeeh
05/19/2020, 2:52 PMJoakimForslund
05/20/2020, 9:09 AMCarlos Fau
05/20/2020, 12:20 PMCarlos Fau
05/20/2020, 1:13 PMpipeline.intercept(ApplicationCallPipeline.Features) {
call.parameters["userId"] --> null
proceed()
}
The problem is that call.parameters["userId"]
is always null. I guess I'm doing something wrong. Any help?Milan Hruban
05/23/2020, 6:14 AMinstall(ContentNegotiation) {
json()
}
on the client side, I use kotlinx-serialization to serialize a sealed class and post it to server but it doesn't work because the kotlinx-serialization produces different format than ktor-server expects. I thought they are supposed to use the same format. What is the way to make them work together?Fábio Carneiro
05/23/2020, 6:23 PMJeff
05/26/2020, 12:27 PMbsimmons
05/26/2020, 12:55 PMio.ktor.client.engine.ios.IosHttpRequestException: Exception in http request: Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid..."Any ideas on how to solve this? (this request works on every other device I've tried.)
Hamza
05/27/2020, 1:36 AMinstall(CORS) {
method(<http://HttpMethod.Post|HttpMethod.Post>)
allowCredentials = true
anyHost()
}
Quy D X Nguyen
05/27/2020, 6:05 PMedenman
05/27/2020, 8:41 PMUrl("bogus")
(it turns that into http://localhost/bogus)….anybody know of a good kmp way to validate a Url?Thiyagu
05/28/2020, 2:10 PMAli
05/29/2020, 1:36 AMaleksey.tomin
05/29/2020, 5:39 AMval result = runBlocking {
<http://client.post|client.post><String>(url) {
contentType(ContentType.Application.Json)
body = json
}
}
ritesh
05/29/2020, 12:27 PMByteArray
and then passing it in the multipart block but server is not accepting it as a multipart request but sees it like a regular post call (and the API is working fine on postman),
val data: ByteArray = ...
val urlString: String = ...
httpClient.request<T>(urlString) {
method = <http://HttpMethod.Post|HttpMethod.Post>
body = MultiPartFormDataContent(
formData {
append("avatar", data)
}
)
}
Can someone point me to right direction what could be wrong/missing here? Is there some other way to upload an image? Do we have to manually set "Content-Type"
as multipart/form-data
somewhere? 🤔Andrew
05/30/2020, 2:02 AMinstall(WebSockets) {
pingPeriod = Duration.ofSeconds(60) // Disabled (null) by default
timeout = Duration.ofSeconds(15)
maxFrameSize = Long.MAX_VALUE // Disabled (max value). The connection will be closed if surpassed this length.
masking = false
}
However, this doesn't actually work (as far as I can tell), because the receiver of the lambda is the type of the first parameter of WebSockets
, which is Unit
. Anyone know where I went wrong?