Package org.miaixz.bus.http.accord
Class Exchange
java.lang.Object
org.miaixz.bus.http.accord.Exchange
Transmits a single HTTP request and a response pair. This layers connection management and events on
HttpCodec, which handles the actual I/O.-
Constructor Summary
ConstructorsConstructorDescriptionExchange(Transmitter transmitter, NewCall call, EventListener eventListener, org.miaixz.bus.http.accord.ExchangeFinder finder, HttpCodec codec) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()org.miaixz.bus.core.io.sink.SinkcreateRequestBody(Request request, boolean duplex) voidRevoke this exchange's access to streams.voidvoidbooleanisDuplex()Returns true if the request body need not complete before the response body starts.voidvoidopenResponseBody(Response response) readResponseHeaders(boolean expectContinue) voidresponseHeadersEnd(Response response) voidvoidtrailers()voidvoidwriteRequestHeaders(Request request)
-
Constructor Details
-
Exchange
public Exchange(Transmitter transmitter, NewCall call, EventListener eventListener, org.miaixz.bus.http.accord.ExchangeFinder finder, HttpCodec codec)
-
-
Method Details
-
connection
-
isDuplex
public boolean isDuplex()Returns true if the request body need not complete before the response body starts. -
writeRequestHeaders
- Throws:
IOException
-
createRequestBody
public org.miaixz.bus.core.io.sink.Sink createRequestBody(Request request, boolean duplex) throws IOException - Throws:
IOException
-
flushRequest
- Throws:
IOException
-
finishRequest
- Throws:
IOException
-
responseHeadersStart
public void responseHeadersStart() -
readResponseHeaders
- Throws:
IOException
-
responseHeadersEnd
-
openResponseBody
- Throws:
IOException
-
trailers
- Throws:
IOException
-
timeoutEarlyExit
public void timeoutEarlyExit() -
newWebSocketStreams
- 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()
-