Skip to content

Commit

Permalink
加了点暂时用不到的
Browse files Browse the repository at this point in the history
  • Loading branch information
KeRan213539 committed Jun 1, 2018
1 parent d8dd62e commit db17d4f
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.internal.http.HttpMethod;

/**
* @ClassName: CommonOkHttpClient
Expand Down Expand Up @@ -118,6 +119,26 @@ public String post(String url,String jsonStr, IAsyncCallback callback) {
return (String)doPost(url, null, jsonStr, callback, null, false, null);
}

public String post(HttpMethod httpMethod, String url, String jsonStr, IAsyncCallback callback) {
// RequestBody body = okhttp3.internal.Util.EMPTY_REQUEST;
// if(StringUtils.isNotBlank(postStr)) {
// body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), postStr);
// } else if(!CollectionUtils.isEmpty(prarm)) {
// Builder builder = new FormBody.Builder();
// prarm.forEach((k, v) -> builder.add(k, v));
// body = builder.build();
// }
// okhttp3.Request.Builder reqBuilder = new Request.Builder().post(body).url(url);
// if(headerExt != null && headerExt.size() > 0) {
// headerExt.forEach((key, value) -> {
// reqBuilder.addHeader(key, value);
// });
// }
// Request request = reqBuilder.build();
// return sendRequest(request, isNeedResponse, callback, callback4Response);
return null;
}

/**
* @Title: post
* @Description: 使用xml方式发送post请求, 有 callback为异步,callback传null为同步;异步时返回null
Expand Down

0 comments on commit db17d4f

Please sign in to comment.