- All Known Implementing Classes:
BridgeInterceptor,CacheInterceptor,CallServerInterceptor,ConnectInterceptor,FileInterceptor,RetryAndFollowUp
public interface Interceptor
Intercepts, observes, modifies, and potentially short-circuits requests and their corresponding responses. Typically,
interceptors add, remove, or transform headers on requests or responses.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidProvides a description of what this interceptor implementation does.Intercepts the givenchainto process a network request.
-
Method Details
-
intercept
Intercepts the givenchainto process a network request.- Parameters:
chain- The network call chain.- Returns:
- The
Responsefrom the network request. - Throws:
IOException- if an I/O error occurs during interception.
-
instructions
default void instructions()Provides a description of what this interceptor implementation does. This can be useful for other business scenarios or services, such as distributed tracing.
-