https://kotlinlang.org logo
Title
c

codyoss

01/26/2019, 2:59 AM
Is there a reason ktor clients don't return one of the companion objects for
HttpStatusCode
? It seems like the code just constructs a new one one that matches the status
Int
. I found this odd when I did a
when
switch on the status from
HttpResponse
and the status did not match
HttpStatusCode.OK
.
e

e5l

01/28/2019, 8:01 AM
Hi @codyoss. The
description
field depends on real server response status line: some APIs transfer valuable information there so we can’t just ignore it.
Probably we could change
HttpStatusCode.equals
to match only int code, could you file an issue?
c

codyoss

01/28/2019, 1:04 PM
Sure that makes sense. Will do!