java.lang.Object
org.miaixz.bus.http.metric.http.CallServerInterceptor
- All Implemented Interfaces:
Interceptor
This is the last interceptor in the chain. It makes a network call to the server.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionCallServerInterceptor(boolean forWebSocket) Constructs a new CallServerInterceptor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.http.metric.Interceptor
instructions
-
Constructor Details
-
CallServerInterceptor
public CallServerInterceptor(boolean forWebSocket) Constructs a new CallServerInterceptor.- Parameters:
forWebSocket- true if this is for a WebSocket upgrade request.
-
-
Method Details
-
intercept
Intercepts the request to make a network call to the server. This method handles writing the request headers and body, and reading the response headers and body. It also manages special cases like "100-continue" expectations and WebSocket upgrades.- Specified by:
interceptin interfaceInterceptor- Parameters:
chain- The interceptor chain.- Returns:
- The response from the server.
- Throws:
IOException- if an I/O error occurs during the network call.
-