I have a call to send data to the server. If everything is ok, the server returns a void response. But when there is an error I get data back.
To manage the case when there is an error I have a CustomResponse
object. The issue is that when the request is successful Retrofit throws an Exception with the message: java.io.EOFException: End of input at line 1 column 1 path $
Here is the call:
@POST("/updateObject")
Observable<CustomResponse> updateObject(@Body CustomObject requestData);
I did a bit of researches and I read that I could use Observable<Response<Void>> ...
but in that case how I'm supposed to manage when the response contains data?