Class OkHttpClient3
- java.lang.Object
-
- com.foxinmy.weixin4j.http.AbstractHttpClient
-
- com.foxinmy.weixin4j.http.support.okhttp.OkHttpClient3
-
- All Implemented Interfaces:
HttpClient
public class OkHttpClient3 extends AbstractHttpClient
OkHttp3- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description OkHttpClient3(okhttp3.OkHttpClient okClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected okhttp3.Request.Builder
createBuilder(HttpRequest request)
create Request.Builderprotected okhttp3.Request
createRequest(HttpRequest request)
create OkRequestHttpResponse
execute(HttpRequest request)
处理请求protected void
resolveContent(okhttp3.Request.Builder builder, HttpRequest request)
resolve Request.Contentprotected void
resolveHeaders(okhttp3.Request.Builder builder, HttpRequest request)
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 okhttp3.Request createRequest(HttpRequest request) throws HttpClientException
create OkRequest- Throws:
HttpClientException
-
createBuilder
protected okhttp3.Request.Builder createBuilder(HttpRequest request) throws HttpClientException
create Request.Builder- Throws:
HttpClientException
-
resolveHeaders
protected void resolveHeaders(okhttp3.Request.Builder builder, HttpRequest request)
resolve Request.Headers
-
resolveContent
protected void resolveContent(okhttp3.Request.Builder builder, HttpRequest request) throws HttpClientException
resolve Request.Content- Throws:
HttpClientException
-
-