예제 #1
0
 public Either<Object, Bitmap> getBitmap(String path) {
   return Either.collapse(
           Either.collapse(
                   execNormalRequest(path, null, HTTPMethod.GET, CONTENT_TYPE_ANY)
                       .bindRight(expectCodes(200)))
               .bindRight(getResultInputStream))
       .bindRight(decodeBitmap);
 }
예제 #2
0
 public Either<Object, JSONArray> getJsonArrayExpectCodes(
     String path, Map<String, String> params, HTTPMethod method, int... codes) {
   return Either.collapse(
       Either.collapse(
               Either.collapse(
                       execNormalRequest(path, params, method, CONTENT_TYPE_JSON)
                           .bindRight(expectCodes(codes)))
                   .bindRight(getBody))
           .bindRight(Util.parseJsonArray));
 }