For the ktor client with `JsonFeature` how do I de...
# ktor
r
For the ktor client with
JsonFeature
how do I deal with two possible response formats e.g. a normal response and an error response?
j
are you getting the correct HTTP status code alongside the error response?
r
Yeah, I think I figured it out already... do
call
, and then in the block, call
receive<Whatever>()
if status = 200.
👍 1
e
Also
1.0-beta
introduce
expectSuccess
option: if status is fail -
get<...>
throws
BadStatusCode
exception