Class: HttpClientResponse

vertx/http. HttpClientResponse

new HttpClientResponse(jresp)

Represents a client-side HTTP response. An instance is provided to the user via a ResponseHandler instance that was specified when one of the HTTP method operations, or the generic request method was called on an instance of module:vertx/http.HttpClient.

It mixes in module:vertx/streams~ReadStream so it can be used with Pump to pump data with flow control.

Parameters:
Name Type Description
jresp org.vertx.java.core.http.HttpClientResponse the underlying Java proxy
Source:
See:

Extends

Methods

bodyHandler(handler) → {module:vertx/http.HttpClientResponse}

Set a handler to receive the entire body in one go - do not use this for large bodies
Parameters:
Name Type Description
handler BodyHandler The handler to use
Source:
Returns:
Type
module:vertx/http.HttpClientResponse

cookies() → {Array}

The Set-Cookie headers (including trailers)
Source:
Returns:
The cookies as an array of strings
Type
Array

dataHandler(handler)

Set a data handler. As data is read, the handler will be called with a Buffer containing the data read.
Parameters:
Name Type Description
handler BodyHandler the handler to call
Inherited From:
Source:

endHandler(handler)

Set an end handler. Once the stream has ended, and there is no more data to be read, the handler will be called.
Parameters:
Name Type Description
handler Handler the handler to call
Inherited From:
Source:

exceptionHandler(handler)

Set an exception handler.
Parameters:
Name Type Description
handler Handler the handler to call
Inherited From:
Source:

headers() → {module:vertx/multi_map~MultiMap}

Get all the headers of the response.
Source:
Returns:
The response headers
Type
module:vertx/multi_map~MultiMap

netSocket() → {module:vertx/net.NetSocket}

Get the NetSocket. Primarily for internal use, but if you really must roll your own websockets or some such, this will let you do that.
Source:
Returns:
The raw NetSocket.
Type
module:vertx/net.NetSocket

pause()

Pause the ReadStream. While the stream is paused, no data will be sent to the data Handler
Inherited From:
Source:

resume()

Resume reading. If the ReadStream has been paused, reading will recommence on it.
Inherited From:
Source:

statusCode() → {number}

The HTTP status code of the response.
Source:
Returns:
The HTTP Status code
Type
number

statusMessage() → {string}

The HTTP Status message of the response
Source:
Returns:
The HTTP Status message
Type
string

trailers() → {module:vertx/multi_map~MultiMap}

Get all the trailing headers of the response.
Source:
Returns:
The response trailers
Type
module:vertx/multi_map~MultiMap