Package: io.vertx.groovy.core.http

## [Groovy] Class HttpClientResponse

- io.vertx.groovy.core.http.HttpClientResponse

- All Implemented Interfaces and Traits:
    ReadStream

      @groovy.transform.CompileStatic
      class HttpClientResponse
      extends java.lang.Object

  Represents a client-side HTTP response.

  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 Pump to pump data with flow control.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `HttpClientResponse (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `HttpClientResponse` | `bodyHandler(io.vertx.core.Handler<Buffer> bodyHandler)` Convenience method for receiving the entire request body in one piece.
    `java.util.List<java.lang.String>` | `cookies()` @return Returns: the Set-Cookie headers (including trailers)
    `HttpClientResponse` | `customFrameHandler(io.vertx.core.Handler<HttpFrame> handler)` Set an custom frame handler.
    `HttpClientResponse` | `endHandler(io.vertx.core.Handler<java.lang.Void> endHandler)`
    `HttpClientResponse` | `exceptionHandler(io.vertx.core.Handler<java.lang.Throwable> handler)`
    `java.lang.Object` | `getDelegate()`
    `java.lang.String` | `getHeader(java.lang.String headerName)` Return the first header value with the specified name
    `java.lang.String` | `getTrailer(java.lang.String trailerName)` Return the first trailer value with the specified name
    `HttpClientResponse` | `handler(io.vertx.core.Handler<Buffer> handler)`
    `MultiMap` | `headers()` @return Returns: the headers
    `NetSocket` | `netSocket()` Get a net socket for the underlying connection of this request.
    `HttpClientResponse` | `pause()`
    `HttpClientResponse` | `resume()`
    `int` | `statusCode()` @return Returns: the status code of the response
    `java.lang.String` | `statusMessage()` @return Returns: the status message of the response
    `MultiMap` | `trailers()` @return Returns: the trailers
    `io.vertx.core.http.HttpVersion` | `version()` @return Returns: the version of the response

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### HttpClientResponse(java.lang.Object delegate)

  - ### Method Detail

    - #### HttpClientResponse bodyHandler(io.vertx.core.Handler<Buffer> bodyHandler)

      Convenience method for receiving the entire request body in one piece.

      This saves you having to manually set a dataHandler and an endHandler and append the chunks of the body until the whole body received. Don't use this if your request body is large - you could potentially run out of RAM.

      Returns:
      Parameters:
        `bodyHandler` - This handler will be called after all the body has been received

    - #### java.util.List<java.lang.String> cookies()

      Returns:
        the Set-Cookie headers (including trailers)

    - #### HttpClientResponse customFrameHandler(io.vertx.core.Handler<HttpFrame> handler)

      Set an custom frame handler. The handler will get notified when the http stream receives an custom HTTP/2 frame. HTTP/2 permits extension of the protocol.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        handler

    - #### HttpClientResponse endHandler(io.vertx.core.Handler<java.lang.Void> endHandler)

    - #### HttpClientResponse exceptionHandler(io.vertx.core.Handler<java.lang.Throwable> handler)

    - #### java.lang.Object getDelegate()

    - #### java.lang.String getHeader(java.lang.String headerName)

      Return the first header value with the specified name

      Returns:
        the header value
      Parameters:
        `headerName` - the header name

    - #### java.lang.String getTrailer(java.lang.String trailerName)

      Return the first trailer value with the specified name

      Returns:
        the trailer value
      Parameters:
        `trailerName` - the trailer name

    - #### HttpClientResponse handler(io.vertx.core.Handler<Buffer> handler)

    - #### MultiMap headers()

      Returns:
        the headers

    - #### NetSocket netSocket()

      Get a net socket for the underlying connection of this request.

      USE THIS WITH CAUTION! Writing to the socket directly if you don't know what you're doing can easily break the HTTP protocol

      One valid use-case for calling this is to receive the NetSocket after a HTTP CONNECT was issued to the remote peer and it responded with a status code of 200.

      Returns:
        the net socket

    - #### HttpClientResponse pause()

    - #### HttpClientResponse resume()

    - #### int statusCode()

      Returns:
        the status code of the response

    - #### java.lang.String statusMessage()

      Returns:
        the status message of the response

    - #### MultiMap trailers()

      Returns:
        the trailers

    - #### io.vertx.core.http.HttpVersion version()

      Returns:
        the version of the response