0

I'm trying to make a POST request with a combination of Retrofit2 and RxAndroid where the API returns empty body if the request if successful (status code 204) or some JSON data in case incorrect data was sent (status code 422).

@POST("/api/v1/audits/")
Completable send(@Body Audit audit);

At the moment I'm using the method above which is working fine but in case an incorrect data was sent I can't notify my user about what went wrong (based on the JSON response).

Any recommendation how to deal with this ?

  • Possible duplicate of [How to get Retrofit success response status codes](https://stackoverflow.com/questions/31808083/how-to-get-retrofit-success-response-status-codes) – Arthur Attout May 19 '19 at 09:26
  • Arthur - Please note that I'm using a Completable not just plain Retrofit2 – László Soós May 19 '19 at 09:43

0 Answers0