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 HttpClientResponsepublic String statusMessage()
statusMessage in interface HttpClientResponsepublic MultiMap headers()
headers in interface HttpClientResponsepublic String getHeader(String headerName)
HttpClientResponsegetHeader in interface HttpClientResponseheaderName - the header namepublic MultiMap trailers()
trailers in interface HttpClientResponsepublic String getTrailer(String trailerName)
HttpClientResponsegetTrailer in interface HttpClientResponsetrailerName - the trailer namepublic List<String> cookies()
cookies in interface HttpClientResponsepublic HttpClientResponse handler(Handler<Buffer> dataHandler)
ReadStreamhandler in interface HttpClientResponsehandler in interface ReadStream<Buffer>public HttpClientResponse endHandler(Handler<Void> endHandler)
ReadStreamendHandler in interface HttpClientResponseendHandler in interface ReadStream<Buffer>public HttpClientResponse exceptionHandler(Handler<Throwable> exceptionHandler)
ReadStreamexceptionHandler in interface HttpClientResponseexceptionHandler in interface ReadStream<Buffer>exceptionHandler in interface StreamBaseexceptionHandler - the exception handlerpublic HttpClientResponse pause()
ReadStreamReadSupport. While it's paused, no data will be sent to the dataHandlerpause in interface HttpClientResponsepause in interface ReadStream<Buffer>public HttpClientResponse resume()
ReadStreamReadSupport has been paused, reading will recommence on it.resume in interface HttpClientResponseresume in interface ReadStream<Buffer>public HttpClientResponse bodyHandler(Handler<Buffer> bodyHandler)
HttpClientResponseThis 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 HttpClientResponsebodyHandler - This handler will be called after all the body has been receivedpublic NetSocket netSocket()
HttpClientResponseUSE 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 HttpClientResponseCopyright © 2015. All Rights Reserved.