Module bus.http

Class CallServerInterceptor

java.lang.Object
org.miaixz.bus.http.metric.http.CallServerInterceptor
All Implemented Interfaces:
Interceptor

public class CallServerInterceptor extends Object implements Interceptor
This is the last interceptor in the chain. It makes a network call to the server.
Since:
Java 17+
Author:
Kimi Liu
  • 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

      public Response intercept(NewChain chain) throws IOException
      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:
      intercept in interface Interceptor
      Parameters:
      chain - The interceptor chain.
      Returns:
      The response from the server.
      Throws:
      IOException - if an I/O error occurs during the network call.