Class OkHttpClient2
- java.lang.Object
-
- com.foxinmy.weixin4j.http.AbstractHttpClient
-
- com.foxinmy.weixin4j.http.support.okhttp.OkHttpClient2
-
- All Implemented Interfaces:
HttpClient
public class OkHttpClient2 extends AbstractHttpClient
OkHttp2- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description OkHttpClient2(com.squareup.okhttp.OkHttpClient okClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.squareup.okhttp.Request.Builder
createBuilder(HttpRequest request)
create Request.Builderprotected com.squareup.okhttp.Request
createRequest(HttpRequest request)
create OkRequestHttpResponse
execute(HttpRequest request)
处理请求protected void
resolveContent(HttpEntity entity, HttpMethod method, com.squareup.okhttp.Request.Builder requestBuilder)
resolve Request.Contentprotected void
resolveHeaders(HttpHeaders headers, com.squareup.okhttp.Request.Builder requestBuilder)
resolve Request.Headers
-
-
-
Method Detail
-
execute
public HttpResponse execute(HttpRequest request) throws HttpClientException
Description copied from interface:HttpClient
处理请求- Parameters:
request
- 请求对象- Returns:
- 响应对象
- Throws:
HttpClientException
-
createRequest
protected com.squareup.okhttp.Request createRequest(HttpRequest request) throws HttpClientException
create OkRequest- Throws:
HttpClientException
-
createBuilder
protected com.squareup.okhttp.Request.Builder createBuilder(HttpRequest request) throws HttpClientException
create Request.Builder- Throws:
HttpClientException
-
resolveHeaders
protected void resolveHeaders(HttpHeaders headers, com.squareup.okhttp.Request.Builder requestBuilder)
resolve Request.Headers
-
resolveContent
protected void resolveContent(HttpEntity entity, HttpMethod method, com.squareup.okhttp.Request.Builder requestBuilder) throws HttpClientException
resolve Request.Content- Throws:
HttpClientException
-
-