class HttpClientResponse extends ReadStream[Buffer]

Represents a client-side HTTP response.

Vert.x provides you with one of these via the handler that was provided when creating the io.vertx.scala.core.http.HttpClientRequest or that was set on the io.vertx.scala.core.http.HttpClientRequest instance.

It implements io.vertx.scala.core.streams.ReadStream so it can be used with io.vertx.scala.core.streams.Pump to pump data with flow control.

Linear Supertypes
ReadStream[Buffer], StreamBase, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpClientResponse
  2. ReadStream
  3. StreamBase
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpClientResponse(_asJava: AnyRef)

Value Members

  1. def asJava: AnyRef
    Definition Classes
    HttpClientResponseReadStreamStreamBase
  2. def bodyHandler(bodyHandler: Handler[Buffer]): HttpClientResponse

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

    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. * @param bodyHandler This handler will be called after all the body has been received

  3. def cookies(): Buffer[String]

    returns

    the Set-Cookie headers (including trailers)

  4. def customFrameHandler(handler: Handler[HttpFrame]): HttpClientResponse

    Set an custom frame 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. * @return a reference to this, so the API can be used fluently

  5. def endHandler(endHandler: Handler[Unit]): HttpClientResponse

    Set an end handler.

    Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called. * @return a reference to this, so the API can be used fluently

    Definition Classes
    HttpClientResponseReadStream
  6. def exceptionHandler(handler: Handler[Throwable]): HttpClientResponse

    Set an exception handler on the read stream.

    Set an exception handler on the read stream. * @param handler the exception handler

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    HttpClientResponseReadStreamStreamBase
  7. def fetch(amount: Long): HttpClientResponse

    Fetch the specified amount of elements.

    Fetch the specified amount of elements. If the ReadStream has been paused, reading will recommence with the specified amount of items, otherwise the specified amount will be added to the current stream demand. * @return a reference to this, so the API can be used fluently

    Definition Classes
    HttpClientResponseReadStream
  8. def getHeader(headerName: String): Option[String]

    Return the first header value with the specified name * @param headerName the header name

    Return the first header value with the specified name * @param headerName the header name

    returns

    the header value

  9. def getTrailer(trailerName: String): Option[String]

    Return the first trailer value with the specified name * @param trailerName the trailer name

    Return the first trailer value with the specified name * @param trailerName the trailer name

    returns

    the trailer value

  10. def handler(handler: Handler[Buffer]): HttpClientResponse

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data. * @return a reference to this, so the API can be used fluently

    Definition Classes
    HttpClientResponseReadStream
  11. def headers(): MultiMap

    returns

    the headers

  12. def netSocket(): NetSocket

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

    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.

    HTTP/1.1 pipe-lined requests cannot support net socket upgrade.

    One valid use-case for calling this is to receive the io.vertx.scala.core.net.NetSocket after a HTTP CONNECT was issued to the remote peer and it responded with a status code of 200. * @return the net socket

  13. def pause(): HttpClientResponse

    Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

    Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

    While it's paused, no data will be sent to the data handler. * @return a reference to this, so the API can be used fluently

    Definition Classes
    HttpClientResponseReadStream
  14. def request(): HttpClientRequest

    returns

    the corresponding request

  15. def resume(): HttpClientResponse

    Resume reading, and sets the buffer in flowing mode.

    Resume reading, and sets the buffer in flowing mode.

    If the ReadStream has been paused, reading will recommence on it. * @return a reference to this, so the API can be used fluently

    Definition Classes
    HttpClientResponseReadStream
  16. def statusCode(): Int

    returns

    the status code of the response

  17. def statusMessage(): String

    returns

    the status message of the response

  18. def streamPriorityHandler(handler: Handler[StreamPriority]): HttpClientResponse

    Set an handler for stream priority changes.

    Set an handler for stream priority changes.

    This is not implemented for HTTP/1.x. * @param handler the handler to be called when the stream priority changes

  19. def trailers(): MultiMap

    returns

    the trailers

  20. def version(): HttpVersion

    returns

    the version of the response