public class HttpClientResponseImpl extends Object implements HttpClientResponse
Modifier and Type | Method and Description |
---|---|
HttpClientResponse |
bodyHandler(Handler<Buffer> bodyHandler)
Convenience method for receiving the entire request body in one piece.
|
List<String> |
cookies() |
HttpClientResponse |
endHandler(Handler<Void> endHandler)
Set an end handler.
|
HttpClientResponse |
exceptionHandler(Handler<Throwable> exceptionHandler)
Set an exception handler on the read stream.
|
String |
getHeader(String headerName)
Return the first header value with the specified name
|
String |
getTrailer(String trailerName)
Return the first trailer value with the specified name
|
HttpClientResponse |
handler(Handler<Buffer> dataHandler)
Set a data handler.
|
MultiMap |
headers() |
NetSocket |
netSocket()
Get a net socket for the underlying connection of this request.
|
HttpClientResponse |
pause()
Pause the
ReadSupport . |
HttpClientResponse |
resume()
Resume reading.
|
int |
statusCode() |
String |
statusMessage() |
MultiMap |
trailers() |
public int statusCode()
statusCode
in interface HttpClientResponse
public String statusMessage()
statusMessage
in interface HttpClientResponse
public MultiMap headers()
headers
in interface HttpClientResponse
public String getHeader(String headerName)
HttpClientResponse
getHeader
in interface HttpClientResponse
headerName
- the header namepublic MultiMap trailers()
trailers
in interface HttpClientResponse
public String getTrailer(String trailerName)
HttpClientResponse
getTrailer
in interface HttpClientResponse
trailerName
- the trailer namepublic List<String> cookies()
cookies
in interface HttpClientResponse
public HttpClientResponse handler(Handler<Buffer> dataHandler)
ReadStream
handler
in interface HttpClientResponse
handler
in interface ReadStream<Buffer>
public HttpClientResponse endHandler(Handler<Void> endHandler)
ReadStream
endHandler
in interface HttpClientResponse
endHandler
in interface ReadStream<Buffer>
public HttpClientResponse exceptionHandler(Handler<Throwable> exceptionHandler)
ReadStream
exceptionHandler
in interface HttpClientResponse
exceptionHandler
in interface ReadStream<Buffer>
exceptionHandler
in interface StreamBase
exceptionHandler
- the exception handlerpublic HttpClientResponse pause()
ReadStream
ReadSupport
. While it's paused, no data will be sent to the dataHandler
pause
in interface HttpClientResponse
pause
in interface ReadStream<Buffer>
public HttpClientResponse resume()
ReadStream
ReadSupport
has been paused, reading will recommence on it.resume
in interface HttpClientResponse
resume
in interface ReadStream<Buffer>
public HttpClientResponse bodyHandler(Handler<Buffer> bodyHandler)
HttpClientResponse
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.
bodyHandler
in interface HttpClientResponse
bodyHandler
- This handler will be called after all the body has been receivedpublic NetSocket netSocket()
HttpClientResponse
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.
netSocket
in interface HttpClientResponse
Copyright © 2015. All Rights Reserved.