vertx / io.vertx.reactivex.core.http / HttpClientResponse

HttpClientResponse

open class HttpClientResponse : 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.reactivex.core.http.HttpClientRequest or that was set on the io.vertx.reactivex.core.http.HttpClientRequest instance.

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

NOTE: This class has been automatically generated from the io.vertx.core.http.HttpClientResponse non RX-ified interface using Vert.x codegen.

Constructors

<init>

HttpClientResponse(delegate: HttpClientResponse)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<HttpClientResponse>

Functions

bodyHandler

open fun bodyHandler(bodyHandler: Handler<Buffer>): HttpClientResponse

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.

cookies

open fun cookies(): MutableList<String>

customFrameHandler

open fun customFrameHandler(handler: Handler<HttpFrame>): HttpClientResponse

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.

endHandler

open fun endHandler(endHandler: Handler<Void>): HttpClientResponse

equals

open fun equals(other: Any?): Boolean

exceptionHandler

open fun exceptionHandler(handler: Handler<Throwable>): HttpClientResponse

getDelegate

open fun getDelegate(): HttpClientResponse

getHeader

open fun getHeader(headerName: String): String

Return the first header value with the specified name

getTrailer

open fun getTrailer(trailerName: String): String

Return the first trailer value with the specified name

handler

open fun handler(handler: Handler<Buffer>): HttpClientResponse

hashCode

open fun hashCode(): Int

headers

open fun headers(): MultiMap

netSocket

open fun 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 io.vertx.reactivex.core.net.NetSocket after a HTTP CONNECT was issued to the remote peer and it responded with a status code of 200.

newInstance

open static fun newInstance(arg: HttpClientResponse): HttpClientResponse

pause

open fun pause(): HttpClientResponse

request

open fun request(): HttpClientRequest

resume

open fun resume(): HttpClientResponse

statusCode

open fun statusCode(): Int

statusMessage

open fun statusMessage(): String

toFlowable

open fun toFlowable(): Flowable<Buffer>

toObservable

open fun toObservable(): Observable<Buffer>

toString

open fun toString(): String

trailers

open fun trailers(): MultiMap

version

open fun version(): HttpVersion