Java 类com.loopj.android.http.RequestHandle 实例源码

项目:GitHub    文件:SynchronousClientSample.java   
@Override
public RequestHandle executeSample(final AsyncHttpClient client, final String URL, final Header[] headers, HttpEntity entity, final ResponseHandlerInterface responseHandler) {
    if (client instanceof SyncHttpClient) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                Log.d(LOG_TAG, "Before Request");
                client.get(SynchronousClientSample.this, URL, headers, null, responseHandler);
                Log.d(LOG_TAG, "After Request");
            }
        }).start();
    } else {
        Log.e(LOG_TAG, "Error, not using SyncHttpClient");
    }
    /**
     * SyncHttpClient does not return RequestHandle,
     * it executes each request directly,
     * therefore those requests are not in cancelable threads
     * */
    return null;
}
项目:GitHub    文件:JsonStreamerSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    RequestParams params = new RequestParams();
    params.setUseJsonStreamer(true);
    JSONObject body;
    if (isRequestBodyAllowed() && (body = getBodyTextAsJSON()) != null) {
        try {
            Iterator keys = body.keys();
            Log.d(LOG_TAG, "JSON data:");
            while (keys.hasNext()) {
                String key = (String) keys.next();
                Log.d(LOG_TAG, "  " + key + ": " + body.get(key));
                params.put(key, body.get(key).toString());
            }
        } catch (JSONException e) {
            Log.w(LOG_TAG, "Unable to retrieve a JSON value", e);
        }
    }
    return client.post(this, URL, headers, params,
            RequestParams.APPLICATION_JSON, responseHandler);
}
项目:GitHub    文件:AsyncBackgroundThreadSample.java   
@Override
public RequestHandle executeSample(final AsyncHttpClient client, final String URL, final Header[] headers, HttpEntity entity, final ResponseHandlerInterface responseHandler) {

    final Activity ctx = this;
    FutureTask<RequestHandle> future = new FutureTask<>(new Callable<RequestHandle>() {
        public RequestHandle call() {
            Log.d(LOG_TAG, "Executing GET request on background thread");
            return client.get(ctx, URL, headers, null, responseHandler);
        }
    });

    executor.execute(future);

    RequestHandle handle = null;
    try {
        handle = future.get(5, TimeUnit.SECONDS);
        Log.d(LOG_TAG, "Background thread for GET request has finished");
    } catch (Exception e) {
        Toast.makeText(ctx, e.getMessage(), Toast.LENGTH_LONG).show();
        e.printStackTrace();
    }

    return handle;
}
项目:GitHub    文件:FilesSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    try {
        RequestParams params = new RequestParams();
        final String contentType = RequestParams.APPLICATION_OCTET_STREAM;
        params.put("fileOne", createTempFile("fileOne", 1020), contentType, "fileOne");
        params.put("fileTwo", createTempFile("fileTwo", 1030), contentType);
        params.put("fileThree", createTempFile("fileThree", 1040), contentType, "customFileThree");
        params.put("fileFour", createTempFile("fileFour", 1050), contentType);
        params.put("fileFive", createTempFile("fileFive", 1060), contentType, "testingFileFive");
        params.setHttpEntityIsRepeatable(true);
        params.setUseJsonStreamer(false);
        return client.post(this, URL, params, responseHandler);
    } catch (FileNotFoundException fnfException) {
        Log.e(LOG_TAG, "executeSample failed with FileNotFoundException", fnfException);
    }
    return null;
}
项目:GitHub    文件:SynchronousClientSample.java   
@Override
public RequestHandle executeSample(final AsyncHttpClient client, final String URL, final Header[] headers, HttpEntity entity, final ResponseHandlerInterface responseHandler) {
    if (client instanceof SyncHttpClient) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                Log.d(LOG_TAG, "Before Request");
                client.get(SynchronousClientSample.this, URL, headers, null, responseHandler);
                Log.d(LOG_TAG, "After Request");
            }
        }).start();
    } else {
        Log.e(LOG_TAG, "Error, not using SyncHttpClient");
    }
    /**
     * SyncHttpClient does not return RequestHandle,
     * it executes each request directly,
     * therefore those requests are not in cancelable threads
     * */
    return null;
}
项目:GitHub    文件:JsonStreamerSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    RequestParams params = new RequestParams();
    params.setUseJsonStreamer(true);
    JSONObject body;
    if (isRequestBodyAllowed() && (body = getBodyTextAsJSON()) != null) {
        try {
            Iterator keys = body.keys();
            Log.d(LOG_TAG, "JSON data:");
            while (keys.hasNext()) {
                String key = (String) keys.next();
                Log.d(LOG_TAG, "  " + key + ": " + body.get(key));
                params.put(key, body.get(key).toString());
            }
        } catch (JSONException e) {
            Log.w(LOG_TAG, "Unable to retrieve a JSON value", e);
        }
    }
    return client.post(this, URL, headers, params,
            RequestParams.APPLICATION_JSON, responseHandler);
}
项目:GitHub    文件:AsyncBackgroundThreadSample.java   
@Override
public RequestHandle executeSample(final AsyncHttpClient client, final String URL, final Header[] headers, HttpEntity entity, final ResponseHandlerInterface responseHandler) {

    final Activity ctx = this;
    FutureTask<RequestHandle> future = new FutureTask<>(new Callable<RequestHandle>() {
        public RequestHandle call() {
            Log.d(LOG_TAG, "Executing GET request on background thread");
            return client.get(ctx, URL, headers, null, responseHandler);
        }
    });

    executor.execute(future);

    RequestHandle handle = null;
    try {
        handle = future.get(5, TimeUnit.SECONDS);
        Log.d(LOG_TAG, "Background thread for GET request has finished");
    } catch (Exception e) {
        Toast.makeText(ctx, e.getMessage(), Toast.LENGTH_LONG).show();
        e.printStackTrace();
    }

    return handle;
}
项目:GitHub    文件:FilesSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    try {
        RequestParams params = new RequestParams();
        final String contentType = RequestParams.APPLICATION_OCTET_STREAM;
        params.put("fileOne", createTempFile("fileOne", 1020), contentType, "fileOne");
        params.put("fileTwo", createTempFile("fileTwo", 1030), contentType);
        params.put("fileThree", createTempFile("fileThree", 1040), contentType, "customFileThree");
        params.put("fileFour", createTempFile("fileFour", 1050), contentType);
        params.put("fileFive", createTempFile("fileFive", 1060), contentType, "testingFileFive");
        params.setHttpEntityIsRepeatable(true);
        params.setUseJsonStreamer(false);
        return client.post(this, URL, params, responseHandler);
    } catch (FileNotFoundException fnfException) {
        Log.e(LOG_TAG, "executeSample failed with FileNotFoundException", fnfException);
    }
    return null;
}
项目:JianDan_AsyncHttpClient    文件:HttpClientProxy.java   
@Nullable
private static RequestHandle call(int method, Context context, String url, RequestParams params, ResponseHandlerInterface responseHandler) {


    if (NetWorkUtil.isNetWorkConnected(context)) {
        switch (method) {
            case METHOD_GET:
                if (params == null) {
                    return getInstance().get(context, url, responseHandler);
                } else {
                    return getInstance().get(context, url, params, responseHandler);
                }
            case METHOD_POST:
                return getInstance().post(context, url, params, responseHandler);
            default:
                return null;
        }
    } else {
        responseHandler.sendFailureMessage(FAILED_NO_NETWORK, null, null, new NetworkErrorException(MESSAGE_NO_NETWORK));
        return null;
    }
}
项目:WeiboWeiBaTong    文件:JsonStreamerSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    RequestParams params = new RequestParams();
    params.setUseJsonStreamer(true);
    JSONObject body;
    if (isRequestBodyAllowed() && (body = getBodyTextAsJSON()) != null) {
        try {
            Iterator keys = body.keys();
            Log.d(LOG_TAG, "JSON data:");
            while (keys.hasNext()) {
                String key = (String) keys.next();
                Log.d(LOG_TAG, "  " + key + ": " + body.get(key));
                params.put(key, body.get(key).toString());
            }
        } catch (JSONException e) {
            Log.w(LOG_TAG, "Unable to retrieve a JSON value", e);
        }
    }
    return client.post(this, URL, headers, params,
            RequestParams.APPLICATION_JSON, responseHandler);
}
项目:WeiboWeiBaTong    文件:FilesSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    try {
        RequestParams params = new RequestParams();
        final String contentType = RequestParams.APPLICATION_OCTET_STREAM;
        params.put("fileOne", createTempFile("fileOne", 1020), contentType, "fileOne");
        params.put("fileTwo", createTempFile("fileTwo", 1030), contentType);
        params.put("fileThree", createTempFile("fileThree", 1040), contentType, "customFileThree");
        params.put("fileFour", createTempFile("fileFour", 1050), contentType);
        params.put("fileFive", createTempFile("fileFive", 1060), contentType, "testingFileFive");
        params.setHttpEntityIsRepeatable(true);
        params.setUseJsonStreamer(false);
        return client.post(this, URL, params, responseHandler);
    } catch (FileNotFoundException fnfException) {
        Log.e(LOG_TAG, "executeSample failed with FileNotFoundException", fnfException);
    }
    return null;
}
项目:saltedge-android    文件:SERestClient.java   
public static boolean post(String servicePath,
                           String jsonRequest,
                           SEHTTPResponseHandler responseHandler,
                           HashMap<String, String> headers) {
    if (isNetworkUnavailable() || responseHandler == null) {
        return false;
    }
    AsyncHttpClient client = createHttpClient(headers);
    RequestHandle handler = null;
    try {
        handler = client.post(SaltEdgeSDK.getInstance().getContext(),
                getAbsoluteUrl(servicePath),
                new StringEntity(jsonRequest, HTTP.UTF_8),
                SEConstants.MIME_TYPE_JSON,
                responseHandler);
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();

    }
    return (handler != null);
}
项目:CuiTrip    文件:ServiceBusiness.java   
public static RequestHandle likeService(Context context, AsyncHttpClient client, LabAsyncHttpResponseHandler handler,
                                           String sid, String serviceName, String serviceAddress, String servicePic
        , String insiderId, String insiderNick, String insiderPic, String insiderCarrer) {
    LabRequestParams params = new LabRequestParams();
    params.setToken(context);
    params.put("sid", sid);
    params.put("type", "1");
    params.put("serviceName", serviceName);
    params.put("serviceAddress", serviceAddress);
    params.put("servicePic", servicePic);
    params.put("insiderId", insiderId);
    params.put("insiderNick", insiderNick);
    params.put("insiderPic", insiderPic);
    params.put("insiderCarrer", insiderCarrer);
    return client.post(context, BusinessHelper.getApiUrl("addLikes"), params, handler);
}
项目:CuiTrip    文件:UserBusiness.java   
public static RequestHandle modifyUserInfo(Context context, AsyncHttpClient client, LabAsyncHttpResponseHandler handler,
                                           String realName, String nick,
                                           String gender, String city, String language, String career,
                                           String interests, String sign) {
    LabRequestParams params = new LabRequestParams();
    params.setToken(context);
    params.put("realName", realName);
    params.put("nick", nick);
    params.put("gender", gender);
    params.put("city", city);
    params.put("language", language);
    params.put("career", career);
    params.put("interests", interests);
    params.put("sign", sign);

    return client.post(context, BusinessHelper.getApiUrl("modifyUserInfo"), params, handler);
}
项目:GitHub    文件:IntentServiceSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    Intent serviceCall = new Intent(this, ExampleIntentService.class);
    serviceCall.putExtra(ExampleIntentService.INTENT_URL, URL);
    startService(serviceCall);
    return null;
}
项目:GitHub    文件:CancelRequestHandleSample.java   
@Override
public void onCancelButtonPressed() {
    Log.d(LOG_TAG, String.format("Number of handles found: %d", getRequestHandles().size()));
    int counter = 0;
    for (RequestHandle handle : getRequestHandles()) {
        if (!handle.isCancelled() && !handle.isFinished()) {
            Log.d(LOG_TAG, String.format("Cancelling handle %d", counter));
            Log.d(LOG_TAG, String.format("Handle %d cancel", counter) + (handle.cancel(true) ? " succeeded" : " failed"));
        } else {
            Log.d(LOG_TAG, String.format("Handle %d already non-cancellable", counter));
        }
        counter++;
    }
}
项目:GitHub    文件:ContentTypeForHttpEntitySample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    RequestParams rParams = new RequestParams();
    rParams.put("sample_key", "Sample String");
    try {
        File sample_file = File.createTempFile("temp_", "_handled", getCacheDir());
        rParams.put("sample_file", sample_file);
    } catch (IOException e) {
        Log.e(LOG_TAG, "Cannot add sample file", e);
    }
    return client.post(this, URL, headers, rParams, "multipart/form-data", responseHandler);
}
项目:GitHub    文件:RangeResponseSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    if (fileSize > 0) {
        // Send a GET query when we know the size of the remote file.
        return client.get(this, URL, headers, null, responseHandler);
    } else {
        // Send a HEAD query to know the size of the remote file.
        return client.head(this, URL, headers, null, responseHandler);
    }
}
项目:GitHub    文件:IntentServiceSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    Intent serviceCall = new Intent(this, ExampleIntentService.class);
    serviceCall.putExtra(ExampleIntentService.INTENT_URL, URL);
    startService(serviceCall);
    return null;
}
项目:GitHub    文件:CancelRequestHandleSample.java   
@Override
public void onCancelButtonPressed() {
    Log.d(LOG_TAG, String.format("Number of handles found: %d", getRequestHandles().size()));
    int counter = 0;
    for (RequestHandle handle : getRequestHandles()) {
        if (!handle.isCancelled() && !handle.isFinished()) {
            Log.d(LOG_TAG, String.format("Cancelling handle %d", counter));
            Log.d(LOG_TAG, String.format("Handle %d cancel", counter) + (handle.cancel(true) ? " succeeded" : " failed"));
        } else {
            Log.d(LOG_TAG, String.format("Handle %d already non-cancellable", counter));
        }
        counter++;
    }
}
项目:GitHub    文件:ContentTypeForHttpEntitySample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    RequestParams rParams = new RequestParams();
    rParams.put("sample_key", "Sample String");
    try {
        File sample_file = File.createTempFile("temp_", "_handled", getCacheDir());
        rParams.put("sample_file", sample_file);
    } catch (IOException e) {
        Log.e(LOG_TAG, "Cannot add sample file", e);
    }
    return client.post(this, URL, headers, rParams, "multipart/form-data", responseHandler);
}
项目:GitHub    文件:RangeResponseSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    if (fileSize > 0) {
        // Send a GET query when we know the size of the remote file.
        return client.get(this, URL, headers, null, responseHandler);
    } else {
        // Send a HEAD query to know the size of the remote file.
        return client.head(this, URL, headers, null, responseHandler);
    }
}
项目:FBEventSync    文件:Graph.java   
public static RequestHandle refreshTokens(Context context, String scopes, AsyncHttpResponseHandler handler) {
    SyncHttpClient client = new SyncHttpClient();
    RequestParams params = new RequestParams();
    params.put("client_id", context.getString(R.string.facebook_app_id));
    params.put("redirect_uri", "https://www.facebook.com/connect/login_success.html");
    params.put("response_type", "token");
    params.put("scopes", scopes);
    return client.get("https://www.facebook.com/v2.9/dialog/oauth", params, handler);
}
项目:Tamic_Retrofit    文件:Tamic.java   
/**
 * @return
 */
private static RequestHandle loadMethodHandler() {

    switch (requestMethod) {

        case GET:
            return TamicHttpClient.get(context, path, headers, bodys, new JsonHttpResponseHandler(true));
        case POST:
            return TamicHttpClient.post(context, path, headers, bodys, contentType, new JsonHttpResponseHandler());
        // more .......
    }

    return null;
}
项目:WeiboWeiBaTong    文件:IntentServiceSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    Intent serviceCall = new Intent(this, ExampleIntentService.class);
    serviceCall.putExtra(ExampleIntentService.INTENT_URL, URL);
    startService(serviceCall);
    return null;
}
项目:ShanBay    文件:BaseSyncHttpClient.java   
public RequestHandle get(Context paramContext, String paramString, RequestParams paramRequestParams, AsyncHttpResponseHandler paramAsyncHttpResponseHandler)
{
  String str = getAbsoluteUrl(paramString);
  d("get:" + str);
  d("params:" + paramRequestParams);
  getSyncHttpClient().addHeader("SBAY-API-VER", "1.0");
  return getSyncHttpClient().get(paramContext, str, paramRequestParams, paramAsyncHttpResponseHandler);
}
项目:CuiTrip    文件:MessageBusiness.java   
public static RequestHandle deleteMessage(Context context, AsyncHttpClient client, LabAsyncHttpResponseHandler handler,
                                          String messageId) {
    LabRequestParams params = new LabRequestParams();
    params.setToken(context);
    params.put("messageId", messageId);
    LogHelper.e("deleteMessage", params.toString());
    return client.post(context, BusinessHelper.getApiUrl("deleteMessage"), params, handler);
}
项目:JianDan_AsyncHttpClient    文件:HttpClientProxy.java   
public static void cancelRequest(List<RequestHandle> handles) {
    if (handles != null && (handles.size() > 0)) {
        for (RequestHandle requestHandle : handles) {
            if ((requestHandle != null) && (!requestHandle.isFinished()) && (!requestHandle.isCancelled())) {
                requestHandle.cancel(true);
            }
        }
    }
}
项目:WeiboWeiBaTong    文件:CancelRequestHandleSample.java   
@Override
public void onCancelButtonPressed() {
    Log.d(LOG_TAG, String.format("Number of handles found: %d", getRequestHandles().size()));
    int counter = 0;
    for (RequestHandle handle : getRequestHandles()) {
        if (!handle.isCancelled() && !handle.isFinished()) {
            Log.d(LOG_TAG, String.format("Cancelling handle %d", counter));
            Log.d(LOG_TAG, String.format("Handle %d cancel", counter) + (handle.cancel(true) ? " succeeded" : " failed"));
        } else {
            Log.d(LOG_TAG, String.format("Handle %d already non-cancellable", counter));
        }
        counter++;
    }
}
项目:ShanBay    文件:BaseSyncHttpClient.java   
public RequestHandle put(Context paramContext, String paramString, RequestParams paramRequestParams, AsyncHttpResponseHandler paramAsyncHttpResponseHandler)
{
  String str = getAbsoluteUrl(paramString);
  d("put:" + str);
  d("params:" + paramRequestParams);
  getSyncHttpClient().addHeader("SBAY-API-VER", "1.0");
  return getSyncHttpClient().put(str, paramRequestParams, paramAsyncHttpResponseHandler);
}
项目:WeiboWeiBaTong    文件:RangeResponseSample.java   
@Override
public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, ResponseHandlerInterface responseHandler) {
    if (fileSize > 0) {
        // Send a GET query when we know the size of the remote file.
        return client.get(this, URL, headers, null, responseHandler);
    } else {
        // Send a HEAD query to know the size of the remote file.
        return client.head(this, URL, headers, null, responseHandler);
    }
}
项目:CuiTrip    文件:MessageBusiness.java   
public static RequestHandle putDialog(Context context, AsyncHttpClient client,
                                      LabAsyncHttpResponseHandler handler, String orderId,
                                      String receiver, String send, String content, String sid) {
    LabRequestParams params = new LabRequestParams();

    params.setToken(context);
    params.put("orderId", orderId);
    params.put("receiver", receiver);
    params.put("send", send);

    params.put("content", content);
    params.put("sid", sid);
    LogHelper.e("putdialog", params.toString());
    return client.post(context, BusinessHelper.getApiUrl("putDialog"), params, handler);
}
项目:ShanBay    文件:HttpClient.java   
public RequestHandle post(Context paramContext, String paramString, RequestParams paramRequestParams, AsyncHttpResponseHandler paramAsyncHttpResponseHandler)
{
  String str = getAbsoluteUrl(paramString);
  d("post:" + str);
  d("params:" + paramRequestParams);
  getAsyncHttpClient().addHeader(SHANBAY_API_VERSION_HEADER_KEY, SHANBAY_API_VERSION_HEADER_VAL);
  return getAsyncHttpClient().post(str, paramRequestParams, paramAsyncHttpResponseHandler);
}
项目:saltedge-android    文件:SERestClient.java   
public static boolean delete(String servicePath,
                             SEHTTPResponseHandler responseHandler,
                             HashMap<String, String> headers) {
    if (isNetworkUnavailable() || responseHandler == null) {
        return false;
    }
    AsyncHttpClient client = createHttpClient(headers);
    RequestHandle handler = client.delete(SaltEdgeSDK.getInstance().getContext(),
            getAbsoluteUrl(servicePath),
            responseHandler);
    return (handler != null);
}
项目:ShanBay    文件:BaseSyncHttpClient.java   
public RequestHandle post(Context paramContext, String paramString, RequestParams paramRequestParams, AsyncHttpResponseHandler paramAsyncHttpResponseHandler)
{
  String str = getAbsoluteUrl(paramString);
  d("post:" + str);
  d("params:" + paramRequestParams);
  getSyncHttpClient().addHeader("SBAY-API-VER", "1.0");
  return getSyncHttpClient().post(str, paramRequestParams, paramAsyncHttpResponseHandler);
}
项目:CuiTrip    文件:OrderBusiness.java   
public static RequestHandle getOrderList(Context context, AsyncHttpClient client, LabAsyncHttpResponseHandler handler,
                                         int userType,int start, int end) {
    LabRequestParams params = new LabRequestParams();
    params.setToken(context);
    params.put("userType", userType);
    params.put("start", start);
    params.put("size", end);
    return client.post(context, BusinessHelper.getApiUrl("getOrderList"), params, handler);
}
项目:CuiTrip    文件:OrderBusiness.java   
public static RequestHandle getOrderInfo(Context context, AsyncHttpClient client, LabAsyncHttpResponseHandler handler,
                                         String oid) {
    LabRequestParams params = new LabRequestParams();
    params.setToken(context);
    params.put("oid", oid);
    return client.post(context, BusinessHelper.getApiUrl("getOrderInfo"), params, handler);
}
项目:CuiTrip    文件:OrderBusiness.java   
/**
 * 旅行者取消旅程
 *
 * @param context
 * @param client
 * @param handler
 * @param oid
 * @return
 */
public static RequestHandle cancelOrder(Context context, AsyncHttpClient client, LabAsyncHttpResponseHandler handler,
                                        String oid, String reason) {
    LabRequestParams params = new LabRequestParams();
    params.setToken(context);
    params.put("oid", oid);
    params.put("reason", reason);
    params.put("type", "1");
    return client.post(context, BusinessHelper.getApiUrl("cancelOrder"), params, handler);
}
项目:CuiTrip    文件:OrderBusiness.java   
public static RequestHandle refuseOrder(Context context, AsyncHttpClient client, LabAsyncHttpResponseHandler handler,
                                        String oid) {
    LabRequestParams params = new LabRequestParams();
    params.setToken(context);
    params.put("oid", oid);
    params.put("type", "2");
    return client.post(context, BusinessHelper.getApiUrl("cancelOrder"), params, handler);
}
项目:CuiTrip    文件:OrderBusiness.java   
public static RequestHandle submitReview(Context context, AsyncHttpClient client, LabAsyncHttpResponseHandler handler,
                                         String oid, String serviceScore, String content) {
    LabRequestParams params = new LabRequestParams();
    params.setToken(context);
    params.put("oid", oid);
    params.put("serviceScore", serviceScore);
    params.put("content", content);
    LogHelper.e("omg","submitReview "+params.toString());
    return client.post(context, BusinessHelper.getApiUrl("submitReview"), params, handler);
}