java.lang.Object
org.miaixz.bus.http.metric.http.BridgeInterceptor
- All Implemented Interfaces:
Interceptor
Bridges from application code to network code. First, it builds a network request from a user request. Then it
proceeds to call the network. Finally, it builds a user response from the network response.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Details
-
BridgeInterceptor
Constructs a new BridgeInterceptor.- Parameters:
cookieJar- The cookie jar to use for cookie management.
-
-
Method Details
-
intercept
Intercepts the request to add necessary headers, handle cookies, and manage content encoding.- Specified by:
interceptin interfaceInterceptor- Parameters:
chain- The interceptor chain.- Returns:
- The response from the server, potentially with modifications (e.g., decompression).
- Throws:
IOException- if an I/O error occurs during the network call.
-