marios proto10/16/2020, 11:21 AM
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
suspend fun get() :Response<DataValue>
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 Siniukov10/16/2020, 11:36 AM
val response = client.get<HttpResponse>(request) val status = response.status val content = response.receive<DataValue>
marios proto10/16/2020, 1:22 PM