if I'm using retrofit to make a call to a no conte...
# android
k
if I'm using retrofit to make a call to a no content endpoint, should I set the return type of the function to be
Call<Unit>
or
Call<Void>
?
l
You should use
Call<Void?>
and use built-in
await()
extension.
Also, #squarelibraries
k
I wasn't sure that this post should have been there or here. I thought square doesn't do a majority of the development for retrofit?
could I mark the method as
suspend
and just mark the return type as
Void?
l
@kevin.cianfarini Suspend integration doesn't support nullable types yet, did you look at the changelog? Also, 204 and 205 bypass converters and always return null (that's a bug), so only
Call<Void?>
will work.
k
Gotcha. I haven't delved too deep into the changelog yet so I wasn't aware.
g
and to remind
Unit
is default return type