if I have jackson support installed, can i use it ...
# ktor
c
if I have jackson support installed, can i use it only for replies, but still set the post body of my request as normal string or byte array? also I have logging installed but it does not seem to log my outgoing requests and post bodies
e
Hi @christophsturm, the post body is not logged, it's known issue and it fixed in
master
. It will be available in the next release.
c
I’m getting a
io.ktor.client.features.ClientRequestException: Client request(....) invalid: 400 Bad Request
it would be useful to have the post body also in the error message, and even more useful to have the body of the 400 reply
e
Could you try to get
response
from the exception and receive body there?
c
thanks will try that!
e
Btw you can also disable converting
400
to exception by disabling
expectSuccess
flag: https://api.ktor.io/1.3.2/io.ktor.client/-http-client-config/index.html It can be useful for debug.
c
sadly the exception does not contain the response (its a parameter but not a val)
👀 1
i think the coolest long term solution would be to have the error message contain both bodies in case of bad request.
it has inherited
response
property, it should work
c
ah its inherited, sorry
was confused from the source
does https://bintray.com/kotlin/ktor/ktor contain master builds? i see only the build for the kotlin eap there.
s
My two cents: for logging response and request bodies, I use this self-written code: https://github.com/SerVB/e-shop/blob/master/server-util/src/main/kotlin/io/github/servb/eShop/util/Logging.kt . I've asked the same question but there is no answer https://kotlinlang.slack.com/archives/C0A974TJ9/p1585379574052900