public class LoggingInterceptor extends Object implements Interceptor
| 构造器和说明 |
|---|
LoggingInterceptor() |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
beforeParse(Method method,
Request request,
BodyType bodyType,
ResponseType responseType,
HttpResponse httpResponse,
HttpParser httpParser)
在请求之后,解析之前执行
|
<T> T |
beforeRequest(Method method,
Request request,
BodyType bodyType,
ResponseType responseType,
HttpExecutor executor)
在请求之前执行
|
public <T> T beforeRequest(Method method, Request request, BodyType bodyType, ResponseType responseType, HttpExecutor executor) throws HttpClientException
InterceptorbeforeRequest 在接口中 InterceptorT - 返回值method - 被调用方法request - 请求数据bodyType - 请求类型responseType - 响应类型executor - 请求执行器null则发出请求,否则直接返回HttpClientExceptionpublic <T> T beforeParse(Method method, Request request, BodyType bodyType, ResponseType responseType, HttpResponse httpResponse, HttpParser httpParser) throws HttpClientException, IOException
InterceptorbeforeParse 在接口中 InterceptorT - 返回null则调用解析器解析,否则直接返回method - 被调用方法request - 请求数据bodyType - 请求类型responseType - 响应类型httpResponse - 响应内容httpParser - 响应内容解析器HttpClientExceptionIOExceptionCopyright © 2019. All rights reserved.