Gyeongmin Go
03/22/2019, 8:54 AM// previous code, io.ktor.client.features.json.JsonFeature
// JsonFeature.Feature object, and install function
scope.requestPipeline.intercept(HttpRequestPipeline.Transform) { payload ->
context.accept(ContentType.Application.Json)
if (context.contentType()?.match(ContentType.Application.Json) != true) {
return@intercept
}
context.headers.remove(HttpHeaders.ContentType)
proceedWith(feature.serializer.write(payload))
}
// forked code
// defined possible content types inside Feature object,
private val allowedContentTypes = listOf(
ContentType.Application.Json,
ContentType.parse("application/x-json")
)
scope.requestPipeline.intercept(HttpRequestPipeline.Transform) { payload ->
allowedContentTypes.forEach { context.accept(it) }
if (allowedContentTypes.none { context.contentType()?.match(it) == true })
return@intercept
context.headers.remove(HttpHeaders.ContentType)
proceedWith(feature.serializer.write(payload))
}
holgerbrandl
03/22/2019, 2:05 PMThomas
03/22/2019, 2:19 PMException in thread "main" java.lang.IllegalStateException: Could not find "/Users/thomas/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-ios-iosx64/1.2.0-alpha-2/e8b5c84525df9fda3ad1e17b950fb2ebb65f4e9d/ktor-client-ios.klib" in [/Users/thomas/AndroidStudioProjects/MyProject/common, /Users/thomas/.konan/klib, /Users/thomas/.konan/kotlin-native-macos-1.2-eap-8554/klib/common, /Users/thomas/.konan/kotlin-native-macos-1.2-eap-8554/klib/platform/ios_x64].
at org.jetbrains.kotlin.konan.library.KonanLibraryProperResolver.resolve(SearchPathResolver.kt:194)
at org.jetbrains.kotlin.konan.library.SearchPathResolver$DefaultImpls.resolve$default(SearchPathResolver.kt:18)
at org.jetbrains.kotlin.konan.library.resolver.impl.KonanLibraryResolverImpl$findLibraries$userProvidedLibraries$1.invoke(KonanLibraryResolverImpl.kt:49)
at org.jetbrains.kotlin.konan.library.resolver.impl.KonanLibraryResolverImpl$findLibraries$userProvidedLibraries$1.invoke(KonanLibraryResolverImpl.kt:24)
at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:172)
at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:698)
at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:728)
at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:719)
at org.jetbrains.kotlin.konan.library.resolver.impl.KonanLibraryResolverImpl.findLibraries(KonanLibraryResolverImpl.kt:50)
at org.jetbrains.kotlin.konan.library.resolver.impl.KonanLibraryResolverImpl.resolveWithDependencies(KonanLibraryResolverImpl.kt:32)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:53)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:18)
Jens Baitinger
03/22/2019, 5:49 PMShreemanArjun
03/23/2019, 2:29 PMjudrummer
03/25/2019, 12:54 PMrocketraman
03/25/2019, 1:47 PMholgerbrandl
03/25/2019, 5:55 PMRainer Schlonvoigt
03/26/2019, 10:13 AMSergioedcigreja
03/26/2019, 10:52 AMVinicius Carvalho
03/26/2019, 2:58 PMHow to intercept preventing additional executions
its not clear where that intercept
function belongs to. Could someone care to explain how to add an interceptor to any route that could prevent the pipeline to continue (verifying a header)kevin.cianfarini
03/28/2019, 11:51 PMalexfacciorusso
03/29/2019, 10:48 AMchan
03/30/2019, 11:25 AMopen class Pipeline<TSubject : Any, TContext : Any>(vararg phases: PipelinePhase)
? The way it's being used is just so fascinating so I hope to get some insights that I can apply it to my own projects.mp
03/30/2019, 1:04 PMlegzo
04/01/2019, 11:15 AMHttpReceivePipeline.Before
with a ResponseObserver
and I don't really understand why my back-ends' logs aren't showing up.
Anyone has a clue ?gregorbg
04/01/2019, 1:15 PMBasicAuth
in the io.ktor:ktor-client-auth
plugin, the exception that gets thrown is a SendCountExceedException
because the engine just tries sending again and again until the treshold is reached/surpassed. How can I change this behaviour so that upon encountering a 401
response code a more "proper" error (along the lines of "AuthenticationFailedException") is thrown?otsuka
04/02/2019, 2:38 AMByteReadChannel
. Is there an example code which writes contents to a file from ByteReadChannel
?
https://ktor.io/clients/http-client/calls/responses.html#HttpResponseMichael Pearce
04/02/2019, 4:58 AM/NettyDispatcher
transaction, because the New Relic agent doesn't have built-in framework support for ktor.legzo
04/04/2019, 10:41 AMResponseObserver
.
Do you have any clue ?Dennis Schröder
04/05/2019, 8:20 AMgaetan
04/05/2019, 1:22 PMjeggy
04/06/2019, 12:05 AMXForwardedHeaderSupport
module, without any luck. using HTTP works perfectly fine.
anyone that knows why this is? or how I should go about debugging this?napperley
04/07/2019, 11:09 PMbdawg.io
04/08/2019, 7:41 PMFlow<T>
preview available for the clients? If not, any suggestions on how it should be approached to integrate into the existing content transformation work?fkrauthan
04/08/2019, 9:54 PMnapperley
04/09/2019, 3:41 AMrodrigo
04/09/2019, 11:44 AMHttpRequestBuilder
and try to specify ContentType(ContentType.Application.Json)
I get Header Content-Type is controlled by the engine and cannot be set explicitly
. I’ve tried adding defaultRequest { ContentType }
into the HttpClient { }
but I still get the same error. How would I go about setting the content type?mp
04/10/2019, 11:23 AMBen
04/10/2019, 9:44 PM*
and */*
and */*/*
Ben
04/10/2019, 9:44 PM*
and */*
and */*/*
e5l
04/11/2019, 12:57 PM