Class HttpClientResponse
- All Implemented Interfaces:
MutinyDelegate,HttpResponseHead,ReadStream<Buffer>,StreamBase
Vert.x provides you with one of these via the handler that was provided when creating the HttpClientRequest
or that was set on the HttpClientRequest instance.
It implements ReadStream so it can be used with
Pipe to pipe data with flow control.
original non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpClientResponse(io.vertx.core.http.HttpClientResponse delegate) HttpClientResponse(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Buffer>body()Same asbody()but with anhandlercalled when the operation completesBlocking variant ofbody().Variant ofbody()that ignores the result of the operation.bodyHandler(Consumer<Buffer> bodyHandler) cookies()customFrameHandler(Consumer<HttpFrame> handler) io.smallrye.mutiny.Uni<Void>end()Same asend()but with anhandlercalled when the operation completesBlocking variant ofend().voidVariant ofend()that ignores the result of the operation.endHandler(Runnable endHandler) booleanexceptionHandler(Consumer<Throwable> handler) fetch(long amount) io.vertx.core.http.HttpClientResponsegetHeader(CharSequence headerName) getTrailer(String trailerName) inthashCode()headers()static HttpClientResponsenewInstance(io.vertx.core.http.HttpClientResponse arg) pause()pipe()io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<Buffer> dst) Pipe thisReadStreamto theWriteStream.pipeToAndAwait(WriteStream<Buffer> dst) Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream).voidpipeToAndForget(WriteStream<Buffer> dst) Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)that ignores the result of the operation.request()resume()intstreamPriorityHandler(Consumer<io.vertx.core.http.StreamPriority> handler) io.smallrye.mutiny.Multi<Buffer>toMulti()toString()trailers()io.vertx.core.http.HttpVersionversion()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HttpClientResponse
public HttpClientResponse(io.vertx.core.http.HttpClientResponse delegate) -
HttpClientResponse
-
-
Method Details
-
getDelegate
public io.vertx.core.http.HttpClientResponse getDelegate()- Specified by:
getDelegatein interfaceHttpResponseHead- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceReadStream<Buffer>- Specified by:
getDelegatein interfaceStreamBase- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
version
public io.vertx.core.http.HttpVersion version()- Specified by:
versionin interfaceHttpResponseHead- Returns:
- the version of the response
-
statusCode
public int statusCode()- Specified by:
statusCodein interfaceHttpResponseHead- Returns:
- the status code of the response
-
statusMessage
- Specified by:
statusMessagein interfaceHttpResponseHead- Returns:
- the status message of the response
-
headers
- Specified by:
headersin interfaceHttpResponseHead- Returns:
- the headers
-
getHeader
- Specified by:
getHeaderin interfaceHttpResponseHead- Parameters:
headerName- the header name- Returns:
- the header value
-
cookies
- Specified by:
cookiesin interfaceHttpResponseHead- Returns:
- the Set-Cookie headers (including trailers)
-
pipe
- Specified by:
pipein interfaceReadStream<Buffer>- Returns:
- a pipe
-
pipeTo
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the
handlerwill be called with the result.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
pipeToin interfaceReadStream<Buffer>- Parameters:
dst- the destination write stream- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
pipeToAndAwait
Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
pipeToAndAwaitin interfaceReadStream<Buffer>- Parameters:
dst- the destination write stream- Returns:
- the Void instance produced by the operation.
-
pipeToAndForget
Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)that ignores the result of the operation.This method subscribes on the result of
ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)but you don't need to compose it with other operations.- Specified by:
pipeToAndForgetin interfaceReadStream<Buffer>- Parameters:
dst- the destination write stream
-
fetch
- Specified by:
fetchin interfaceReadStream<Buffer>- Returns:
- a reference to this, so the API can be used fluently
-
resume
- Specified by:
resumein interfaceReadStream<Buffer>- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
- Specified by:
exceptionHandlerin interfaceReadStream<Buffer>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler- Returns:
-
handler
- Specified by:
handlerin interfaceReadStream<Buffer>- Returns:
-
pause
- Specified by:
pausein interfaceReadStream<Buffer>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
- Specified by:
endHandlerin interfaceReadStream<Buffer>- Returns:
-
netSocket
- Returns:
- a
NetSocketfacade to interact with the HTTP client response.
-
getTrailer
- Parameters:
trailerName- the trailer name- Returns:
- the trailer value
-
trailers
- Returns:
- the trailers
-
bodyHandler
- Parameters:
bodyHandler- This handler will be called after all the body has been received- Returns:
-
body
Same asbody()but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
bodyAndAwait
Blocking variant ofbody().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Buffer instance produced by the operation.
-
bodyAndForget
Variant ofbody()that ignores the result of the operation.This method subscribes on the result of
body(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frombody()but you don't need to compose it with other operations.- Returns:
- the instance of HttpClientResponse to chain method calls.
-
end
Same asend()but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Blocking variant ofend().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
endAndForget
public void endAndForget() -
customFrameHandler
- Parameters:
handler-- Returns:
-
request
- Returns:
- the corresponding request
-
streamPriorityHandler
public HttpClientResponse streamPriorityHandler(Consumer<io.vertx.core.http.StreamPriority> handler) - Parameters:
handler- the handler to be called when the stream priority changes- Returns:
-
getHeader
- Specified by:
getHeaderin interfaceHttpResponseHead- Parameters:
headerName- the header name- Returns:
- the header value
-
toMulti
- Specified by:
toMultiin interfaceReadStream<Buffer>
-
toBlockingIterable
-
toBlockingStream
-
newInstance
-