with ktor, are we able to access the response body...
# ktor
a
with ktor, are we able to access the response body at all if we use a serialized class as the response type?
🚫 1
j
I hope you dont use java serialisation (which is a security problem)
d
serialized with a small 's'. 🙂
e
You could get response first:
Copy code
val response = client.get<HttpResponse>(...)
and then receive from it:
Copy code
response.receive<MyData>()
☝️ 2
👍 2
a
Thank you, will try it, although, does Ktor throw on any error?
e
It can, depends on your case.
a
Http errors it will throw on, yes?
If I wanted to handle those on my own, how would I do it?