wakingrufus
04/26/2019, 4:41 PMrequest<HttpResponse>
I can check for status and other things in order to do my own error handling, but then i can't leverage the built in Json deserialization of my object. but if i call request<MyObject>
in order to get the deserialization, it is not clear how to check and handle errors. I am looking for something like Fuel's `Result.fold`: inline fun <X> fold(success: (V) -> X, failure: (E) -> X): X = when (this) {
is Success -> success(this.value)
is Failure -> failure(this.error)
}
. is there something like this in ktor?obobo
04/26/2019, 5:39 PMHttpResponse
you can use receive()
to automatically deserialize json.wakingrufus
04/26/2019, 5:48 PMwakingrufus
04/26/2019, 9:10 PM