Packages

class HttpRequest[T] extends AnyRef

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

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 .

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpRequest
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpRequest(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addQueryParam(paramName: String, paramValue: String): HttpRequest[T]

    Add a query parameter to the request.

    Add a query parameter to the request. * @param paramName the param name

    paramValue

    the param value

    returns

    a reference to this, so the API can be used fluently

  5. def as[U](responseCodec: BodyCodec[U])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[U]): HttpRequest[U]

    Configure the request to decode the response with the responseCodec.

    Configure the request to decode the response with the responseCodec. * @param responseCodec the response codec

    returns

    a reference to this, so the API can be used fluently

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def asJava: AnyRef
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. def copy(): HttpRequest[T]

    Copy this request * @return a copy of this request

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def expect(predicate: ResponsePredicate): HttpRequest[T]

    Add an expectation that the response is valid according to the provided predicate.

    Add an expectation that the response is valid according to the provided predicate.

    Multiple predicates can be added. * @param predicate the predicate

    returns

    a reference to this, so the API can be used fluently

  13. def expect(predicate: (HttpResponse[Unit]) ⇒ ResponsePredicateResult): HttpRequest[T]

    Add an expectation that the response is valid according to the provided predicate.

    Add an expectation that the response is valid according to the provided predicate.

    Multiple predicates can be added. * @param predicate the predicate

    returns

    a reference to this, so the API can be used fluently

  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def followRedirects(value: Boolean): HttpRequest[T]

    Set wether or not to follow the directs for the request.

    Set wether or not to follow the directs for the request. * @param value true if redirections should be followed

    returns

    a reference to this, so the API can be used fluently

  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def headers(): MultiMap

    returns

    The HTTP headers

  19. def host(value: String): HttpRequest[T]

    Configure the request to use a new host value.

    Configure the request to use a new host value. * @return a reference to this, so the API can be used fluently

  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def method(value: HttpMethod): HttpRequest[T]

    Configure the request to use a new method value.

    Configure the request to use a new method value. * @return a reference to this, so the API can be used fluently

  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. def port(value: Int): HttpRequest[T]

    Configure the request to use a new port value.

    Configure the request to use a new port value. * @return a reference to this, so the API can be used fluently

  26. def putHeader(name: String, value: String): HttpRequest[T]

    Configure the request to add a new HTTP header.

    Configure the request to add a new HTTP header. * @param name the header name

    value

    the header value

    returns

    a reference to this, so the API can be used fluently

  27. def queryParams(): MultiMap

    Return the current query parameters.

    Return the current query parameters. * @return the current query parameters

  28. def send(handler: Handler[AsyncResult[HttpResponse[T]]]): Unit

    Send a request, the handler will receive the response as an io.vertx.scala.ext.web.client.HttpResponse.

  29. def sendBuffer(body: Buffer, handler: Handler[AsyncResult[HttpResponse[T]]]): Unit

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body buffer.

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body buffer. * @param body the body

  30. def sendBufferFuture(body: Buffer): Future[HttpResponse[T]]

    Like sendBuffer but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  31. def sendForm(body: MultiMap, handler: Handler[AsyncResult[HttpResponse[T]]]): Unit

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body multimap encoded as form and the content type set to application/x-www-form-urlencoded.

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body multimap encoded as form and the content type set to application/x-www-form-urlencoded.

    When the content type header is previously set to multipart/form-data it will be used instead. * @param body the body

  32. def sendFormFuture(body: MultiMap): Future[HttpResponse[T]]

    Like sendForm but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  33. def sendFuture(): Future[HttpResponse[T]]

    Like send but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  34. def sendJson(body: AnyRef, handler: Handler[AsyncResult[HttpResponse[T]]]): Unit

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body object encoded as json and the content type set to application/json.

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body object encoded as json and the content type set to application/json. * @param body the body

  35. def sendJsonFuture(body: AnyRef): Future[HttpResponse[T]]

    Like sendJson but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  36. def sendJsonObject(body: JsonObject, handler: Handler[AsyncResult[HttpResponse[T]]]): Unit

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body object encoded as json and the content type set to application/json.

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body object encoded as json and the content type set to application/json. * @param body the body

  37. def sendJsonObjectFuture(body: JsonObject): Future[HttpResponse[T]]

    Like sendJsonObject but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  38. def sendMultipartForm(body: MultipartForm, handler: Handler[AsyncResult[HttpResponse[T]]]): Unit

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body multimap encoded as form and the content type set to multipart/form-data.

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body multimap encoded as form and the content type set to multipart/form-data. You may use this method to send attributes and upload files. * @param body the body

  39. def sendMultipartFormFuture(body: MultipartForm): Future[HttpResponse[T]]

    Like sendMultipartForm but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  40. def sendStream(body: ReadStream[Buffer], handler: Handler[AsyncResult[HttpResponse[T]]]): Unit

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body stream.

    Like io.vertx.scala.ext.web.client.HttpRequest#send but with an HTTP request body stream. * @param body the body

  41. def sendStreamFuture(body: ReadStream[Buffer]): Future[HttpResponse[T]]

    Like sendStream but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  42. def setQueryParam(paramName: String, paramValue: String): HttpRequest[T]

    Set a query parameter to the request.

    Set a query parameter to the request. * @param paramName the param name

    paramValue

    the param value

    returns

    a reference to this, so the API can be used fluently

  43. def ssl(value: Boolean): HttpRequest[T]
  44. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  45. def timeout(value: Long): HttpRequest[T]

    Configures the amount of time in milliseconds after which if the request does not return any data within the timeout period an TimeoutException fails the request.

    Configures the amount of time in milliseconds after which if the request does not return any data within the timeout period an TimeoutException fails the request.

    Setting zero or a negative value disables the timeout. * @param value The quantity of time in milliseconds.

    returns

    a reference to this, so the API can be used fluently

  46. def toString(): String
    Definition Classes
    AnyRef → Any
  47. def uri(value: String): HttpRequest[T]

    Configure the request to use a new request URI value.

    Configure the request to use a new request URI value.

    When the uri has query parameters, they are set in the io.vertx.scala.ext.web.client.HttpRequest#queryParams multimap, overwritting any parameters previously set. * @return a reference to this, so the API can be used fluently

  48. def virtualHost(value: String): HttpRequest[T]

    Configure the request to use a virtual host value.

    Configure the request to use a virtual host value.

    Usually the header host (:authority pseudo header for HTTP/2) is set from the request host value since this host value resolves to the server IP address.

    Sometimes you need to set a host header for an address that does not resolve to the server IP address. The virtual host value overrides the value of the actual host header (:authority pseudo header for HTTP/2).

    The virtual host is also be used for SNI. * @return a reference to this, so the API can be used fluently

  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped