接口 AsyncClientHttpRequestInterceptor
@Deprecated public interface AsyncClientHttpRequestInterceptor
已过时。as of Spring 5.0, in favor ofExchangeFilterFunctionIntercepts client-side HTTP requests. Implementations of this interface can be registered with theAsyncRestTemplateas to modify the outgoingHttpRequestand/or register to modify the incomingClientHttpResponsewith help of aListenableFutureAdapter.The main entry point for interceptors is
intercept(org.springframework.http.HttpRequest, byte[], org.springframework.http.client.AsyncClientHttpRequestExecution).- 从以下版本开始:
- 4.3
- 作者:
- Jakub Narloch, Rossen Stoyanchev
- 另请参阅:
AsyncRestTemplate,InterceptingAsyncHttpAccessor
方法概要
所有方法 实例方法 抽象方法 已过时的方法 修饰符和类型 方法 说明 ListenableFuture<ClientHttpResponse>intercept(HttpRequest request, byte[] body, AsyncClientHttpRequestExecution execution)已过时。Intercept the given request, and return a response future.
方法详细资料
intercept
ListenableFuture<ClientHttpResponse> intercept(HttpRequest request, byte[] body, AsyncClientHttpRequestExecution execution) throws IOException
已过时。Intercept the given request, and return a response future. The givenAsyncClientHttpRequestExecutionallows the interceptor to pass on the request to the next entity in the chain.An implementation might follow this pattern:
- Examine the request and body
- Optionally wrap the request to filter HTTP attributes.
- Optionally modify the body of the request.
- One of the following:
- execute the request through
ClientHttpRequestExecution - don't execute the request to block the execution altogether
- execute the request through
- Optionally adapt the response to filter HTTP attributes with the help of
ListenableFutureAdapter.
- 参数:
request- the request, containing method, URI, and headersbody- the body of the requestexecution- the request execution- 返回:
- the response future
- 抛出:
IOException- in case of I/O errors