Get response status code using Retrofit 2.0 and RxJava
I'm trying to upgrade to Retrofit 2.0 and add RxJava in my android project. I'm making an api call and want to retrieve the error code in case of an error response from the server. Observable<MyResponseObject> apiCall(@Body body); And in the RxJava call: myRetrofitObject.apiCall(body).subscribe(new Subscriber<MyResponseObject>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { } @Override public void onNext(MyResponseObject myResponseObject) { //On response from server } }); In Retrofit 1.9, the RetrofitError still existed and we could get the status by