Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 public Observable internalServerError() {
   return Observable.create(
           subscriber -> {
             ResponseJsonMapper mapper = new ResponseJsonMapper();
             subscriber.onNext(
                 mapper.transformResponse(getService().getInternalServerError(), Post.class));
             subscriber.onCompleted();
           })
       .compose(applySchedulers());
 }