public Observable post(@NonNull String param) { return Observable.create( subscriber -> { ResponseJsonMapper mapper = new ResponseJsonMapper(); subscriber.onNext(mapper.transformResponse(getService().post(param), Post.class)); subscriber.onCompleted(); }) .compose(applySchedulers()); }
public Observable internalServerError() { return Observable.create( subscriber -> { ResponseJsonMapper mapper = new ResponseJsonMapper(); subscriber.onNext( mapper.transformResponse(getService().getInternalServerError(), Post.class)); subscriber.onCompleted(); }) .compose(applySchedulers()); }