Module bus.http

Class Exchange

java.lang.Object
org.miaixz.bus.http.accord.Exchange

public final class Exchange extends Object
Transmits a single HTTP request and a response pair. This layers connection management and events on HttpCodec, which handles the actual I/O.
  • Constructor Details

  • Method Details

    • connection

      public RealConnection connection()
    • isDuplex

      public boolean isDuplex()
      Returns true if the request body need not complete before the response body starts.
    • writeRequestHeaders

      public void writeRequestHeaders(Request request) throws IOException
      Throws:
      IOException
    • createRequestBody

      public org.miaixz.bus.core.io.sink.Sink createRequestBody(Request request, boolean duplex) throws IOException
      Throws:
      IOException
    • flushRequest

      public void flushRequest() throws IOException
      Throws:
      IOException
    • finishRequest

      public void finishRequest() throws IOException
      Throws:
      IOException
    • responseHeadersStart

      public void responseHeadersStart()
    • readResponseHeaders

      public Response.Builder readResponseHeaders(boolean expectContinue) throws IOException
      Throws:
      IOException
    • responseHeadersEnd

      public void responseHeadersEnd(Response response)
    • openResponseBody

      public ResponseBody openResponseBody(Response response) throws IOException
      Throws:
      IOException
    • trailers

      public Headers trailers() throws IOException
      Throws:
      IOException
    • timeoutEarlyExit

      public void timeoutEarlyExit()
    • newWebSocketStreams

      public RealWebSocket.Streams newWebSocketStreams() throws SocketException
      Throws:
      SocketException
    • webSocketUpgradeFailed

      public void webSocketUpgradeFailed()
    • noNewExchangesOnConnection

      public void noNewExchangesOnConnection()
    • cancel

      public void cancel()
    • detachWithViolence

      public void detachWithViolence()
      Revoke this exchange's access to streams. This is necessary when a follow-up request is required but the preceding exchange hasn't completed yet.
    • noRequestBody

      public void noRequestBody()