I'm trying to use RetroFit's responseBodyConverter()
but I'm having some trouble, I'm expected to pass java.lang.annoatation.annoatation
as the second parameter, but Kotlin suggests against that and says to use Kotlin.Annotation
. I'm unsure of how to do that. Can someone provide an example of responseBodyConverter()
in Kotlin?
Retrofit is a type-safe REST client for Android, Java and Kotlin developed by Square. The library provides a powerful framework for authenticating and interacting with APIs and sending network requests with OkHttp. See this guide to understand how OkHttp works.
Kotlin and retrofit network call tutorial What is retrofit. This is a rest client library for java and android. This means that we. use retrofit to make network calls from our applications. In android applications, Retrofit makes use of OkHttp which is a low level.
@bluecup
in the AndroidChat slack channel has led me to the correct answer. I ended up doing the following:
Retrofit.responseBodyConverter(<T>, arrayOfNulls<Annotation>(0))
Hope this helps someone else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With