marios proto
10/16/2020, 11:21 AMsuspend fun get() :Response<DataValue>
in Retrofit would give me a response code, a way to parse an error model returned, etc easily.
How can I have this in Ktor? Haven't seen it in the examples, unless using the HttpResponseValidator
function to the Client configuration, which I will have to configure per api call.
I am pretty sure there is an easier way, but could someone point me to a good example please?Rustam Siniukov
10/16/2020, 11:36 AMval response = client.get<HttpResponse>(request)
val status = response.status
val content = response.receive<DataValue>
marios proto
10/16/2020, 1:22 PM