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.
- Alphabetic
- By Inheritance
- HttpClientResponse
- ReadStream
- StreamBase
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new HttpClientResponse(_asJava: AnyRef)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava: AnyRef
- Definition Classes
- HttpClientResponse → ReadStream → StreamBase
-
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
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
cookies(): Buffer[String]
- returns
the Set-Cookie headers (including trailers)
-
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
-
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
- HttpClientResponse → ReadStream
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
- HttpClientResponse → ReadStream → StreamBase
-
def
fetch(amount: Long): HttpClientResponse
Fetch the specified
amount
of elements.Fetch the specified
amount
of elements. If theReadStream
has been paused, reading will recommence with the specifiedamount
of items, otherwise the specifiedamount
will be added to the current stream demand. * @return a reference to this, so the API can be used fluently- Definition Classes
- HttpClientResponse → ReadStream
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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
-
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
-
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
- HttpClientResponse → ReadStream
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
headers(): MultiMap
- returns
the headers
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
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
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
pause(): HttpClientResponse
Pause the
ReadStream
, it sets the buffer infetch
mode and clears the actual demand.Pause the
ReadStream
, it sets the buffer infetch
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
- HttpClientResponse → ReadStream
-
def
request(): HttpClientRequest
- returns
the corresponding request
-
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
- HttpClientResponse → ReadStream
-
def
statusCode(): Int
- returns
the status code of the response
-
def
statusMessage(): String
- returns
the status message of the response
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
trailers(): MultiMap
- returns
the trailers
-
def
version(): HttpVersion
- returns
the version of the response
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )