https://kotlinlang.org logo
#android
Title
# android
h

Hexa

12/27/2018, 10:15 AM
does anyone know if this is the right way to send protobuf message in the payload via Retrofit? https://stackoverflow.com/a/34639315
a

ahulyk

12/27/2018, 11:01 AM
this is offtop here 🙂 btw: public interface ServiceApi { @POST("user/login") Call<ResponseBody> login(@Body Data data); } use a @Body annotation
l

louiscad

12/27/2018, 11:03 AM
@Hexa Doesn't seem so Kotlin and Android related (so more #random suited), but we can continue in this thread now… There are multiple right ways (including the ones you linked) if you don't have any constraints. Are you looking for something particular?
h

Hexa

12/27/2018, 11:05 AM
thanks, just wanted to confirm that I can indeed send protobuf message via Retrofit, and what is the best to do it. I know that post is written in Java but I write all my stuff in Kotlin
l

louiscad

12/27/2018, 11:13 AM
What is best is to use retrofit with coroutines using @gildor's library (until retrofit brings out of the box coroutines support), regardless of the converters.