package client
- Alphabetic
- Public
- All
Type Members
-
class
HttpRequest[T] extends AnyRef
A client-side HTTP request.
A client-side HTTP request.
Instances are created by an io.vertx.scala.ext.web.client.WebClient instance, via one of the methods corresponding to the specific HTTP methods such as io.vertx.scala.ext.web.client.WebClient#get, etc...
The request shall be configured prior sending, the request is immutable and when a mutator method is called, a new request is returned allowing to expose the request in a public API and apply further customization.
After the request has been configured, the methods
- io.vertx.scala.ext.web.client.HttpRequest#send
- io.vertx.scala.ext.web.client.HttpRequest#sendStream
- io.vertx.scala.ext.web.client.HttpRequest#sendJson ()}
- io.vertx.scala.ext.web.client.HttpRequest#sendForm
can be called. The
sendXXX
methods perform the actual request, they can be called multiple times to perform the same HTTP request at different points in time.The handler is called back with
- an io.vertx.scala.ext.web.client.HttpResponse instance when the HTTP response has been received
- a failure when the HTTP request failed (like a connection error) or when the HTTP response could not be obtained (like connection or unmarshalling errors)
Most of the time, this client will buffer the HTTP response fully unless a specific is used such as .
-
class
HttpResponse[T] extends AnyRef
An HTTP response.
An HTTP response.
The usual HTTP response attributes are available:
- io.vertx.scala.ext.web.client.HttpResponse#statusCode the HTTP status code
- io.vertx.scala.ext.web.client.HttpResponse#statusMessage the HTTP status message
- io.vertx.scala.ext.web.client.HttpResponse#headers the HTTP headers
- io.vertx.scala.ext.web.client.HttpResponse#version the HTTP version
The body of the response is returned by io.vertx.scala.ext.web.client.HttpResponse#body decoded as the format specified by the io.vertx.scala.ext.web.codec.BodyCodec that built the response.
Keep in mind that using this
HttpResponse
impose to fully buffer the response body and should be used for payload that can fit in memory. -
class
WebClient extends AnyRef
An asynchronous HTTP / HTTP/2 client called
WebClient
.An asynchronous HTTP / HTTP/2 client called
WebClient
.The web client makes easy to do HTTP request/response interactions with a web server, and provides advanced features like:
- Json body encoding / decoding
- request/response pumping
- error handling
The web client does not deprecate the , it is actually based on it and therefore inherits its configuration and great features like pooling. The
HttpClient
should be used when fine grained control over the HTTP requests/response is necessary. - class WebClientOptions extends HttpClientOptions
Value Members
- object HttpRequest
- object HttpResponse
- object WebClient
- object WebClientOptions