https://kotlinlang.org logo
#ktor
Title
# ktor
d

Dias

02/13/2019, 11:27 AM
When I use ktor http client I want to read a message that comes with an unsuccessful response status, like 500, but when I call
response.receive<String>()
it throws with BadResponseStatusException. I kinda understand the reason for that, but how do I read a message that comes with bad response?
e

e5l

02/13/2019, 11:52 AM
Hi @Dias. You could disable
expectSuccess
in client config.
d

Dias

02/13/2019, 11:54 AM
ah! that's what I was looking for, thank you, I wonder if it should be default behaviour tho