Class HttpClientResponse

    • Constructor Detail

      • HttpClientResponse

        public HttpClientResponse​(io.vertx.core.http.HttpClientResponse delegate)
      • HttpClientResponse

        public HttpClientResponse​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • version

        public io.vertx.core.http.HttpVersion version()
        Specified by:
        version in interface HttpResponseHead
        Returns:
        the version of the response
      • statusCode

        public int statusCode()
        Specified by:
        statusCode in interface HttpResponseHead
        Returns:
        the status code of the response
      • pipeTo

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> pipeTo​(WriteStream<Buffer> dst)
        Pipe this ReadStream to the WriteStream.

        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 handler will 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:
        pipeTo in interface ReadStream<Buffer>
        Parameters:
        dst - the destination write stream
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • netSocket

        public NetSocket netSocket()
        Returns:
        a NetSocket facade to interact with the HTTP client response.
      • getTrailer

        public String getTrailer​(String trailerName)
        Parameters:
        trailerName - the trailer name
        Returns:
        the trailer value
      • trailers

        public MultiMap trailers()
        Returns:
        the trailers
      • bodyHandler

        public HttpClientResponse bodyHandler​(Consumer<Buffer> bodyHandler)
        Parameters:
        bodyHandler - This handler will be called after all the body has been received
        Returns:
      • body

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Buffer> body()
        Same as body() but with an handler called when the operation completes

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • bodyAndAwait

        public Buffer bodyAndAwait()
        Blocking variant of body().

        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

        public HttpClientResponse bodyAndForget()
        Variant of body() 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 from body() but you don't need to compose it with other operations.

        Returns:
        the instance of HttpClientResponse to chain method calls.
      • end

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> end()
        Same as end() but with an handler called when the operation completes

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • endAndAwait

        public Void endAndAwait()
        Blocking variant of end().

        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()
        Variant of end() that ignores the result of the operation.

        This method subscribes on the result of end(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from end() but you don't need to compose it with other operations.

      • streamPriorityHandler

        public HttpClientResponse streamPriorityHandler​(Consumer<io.vertx.core.http.StreamPriority> handler)
        Parameters:
        handler - the handler to be called when the stream priority changes
        Returns:
      • toBlockingStream

        public Stream<Buffer> toBlockingStream()
      • newInstance

        public static HttpClientResponse newInstance​(io.vertx.core.http.HttpClientResponse arg)