java.lang.Object
io.vertx.mutiny.ext.web.client.HttpResponse<T>
All Implemented Interfaces:
io.smallrye.mutiny.vertx.MutinyDelegate, io.vertx.mutiny.core.http.HttpResponseHead

public class HttpResponse<T> extends Object implements io.smallrye.mutiny.vertx.MutinyDelegate, io.vertx.mutiny.core.http.HttpResponseHead
An HTTP response.

The usual HTTP response attributes are available:

  • HttpResponseHead.statusCode() the HTTP status code
  • HttpResponseHead.statusMessage() the HTTP status message
  • HttpResponseHead.headers() the HTTP headers
  • HttpResponseHead.version() the HTTP version

The body of the response is returned by body() decoded as the format specified by the 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.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

  • Field Details

    • __TYPE_ARG

      public static final io.smallrye.mutiny.vertx.TypeArg<HttpResponse> __TYPE_ARG
    • __typeArg_0

      public final io.smallrye.mutiny.vertx.TypeArg<T> __typeArg_0
  • Constructor Details

    • HttpResponse

      public HttpResponse(io.vertx.ext.web.client.HttpResponse delegate)
    • HttpResponse

      public HttpResponse(Object delegate, io.smallrye.mutiny.vertx.TypeArg<T> typeArg_0)
    • HttpResponse

      public HttpResponse(io.vertx.ext.web.client.HttpResponse delegate, io.smallrye.mutiny.vertx.TypeArg<T> typeArg_0)
  • Method Details

    • getDelegate

      public io.vertx.ext.web.client.HttpResponse getDelegate()
      Specified by:
      getDelegate in interface io.vertx.mutiny.core.http.HttpResponseHead
      Specified by:
      getDelegate in interface io.smallrye.mutiny.vertx.MutinyDelegate
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • version

      public io.vertx.core.http.HttpVersion version()
      Specified by:
      version in interface io.vertx.mutiny.core.http.HttpResponseHead
    • statusCode

      public int statusCode()
      Specified by:
      statusCode in interface io.vertx.mutiny.core.http.HttpResponseHead
    • statusMessage

      public String statusMessage()
      Specified by:
      statusMessage in interface io.vertx.mutiny.core.http.HttpResponseHead
    • headers

      public io.vertx.mutiny.core.MultiMap headers()
      Specified by:
      headers in interface io.vertx.mutiny.core.http.HttpResponseHead
    • getHeader

      public String getHeader(String arg0)
      Specified by:
      getHeader in interface io.vertx.mutiny.core.http.HttpResponseHead
    • cookies

      public List<String> cookies()
      Specified by:
      cookies in interface io.vertx.mutiny.core.http.HttpResponseHead
    • trailers

      public io.vertx.mutiny.core.MultiMap trailers()
      Returns:
      the trailers
    • getTrailer

      public String getTrailer(String trailerName)
      Parameters:
      trailerName - the trailer name
      Returns:
      the trailer value
    • body

      public T body()
      Returns:
      the response body in the format it was decoded.
    • bodyAsBuffer

      public io.vertx.mutiny.core.buffer.Buffer bodyAsBuffer()
      Returns:
      the response body decoded as a , or null if a codec other than was used
    • followedRedirects

      public List<String> followedRedirects()
      Returns:
      the list of all followed redirects, including the final location.
    • bodyAsString

      public String bodyAsString()
      Returns:
      the response body decoded as a String, or null if a codec other than was used
    • bodyAsString

      public String bodyAsString(String encoding)
      Parameters:
      encoding -
      Returns:
      the response body decoded as a String given a specific encoding, or null if a codec other than was used
    • bodyAsJsonObject

      public io.vertx.core.json.JsonObject bodyAsJsonObject()
      Returns:
      the response body decoded as , or null if a codec other than was used
    • bodyAsJsonArray

      public io.vertx.core.json.JsonArray bodyAsJsonArray()
      Returns:
      the response body decoded as a , or null if a codec other than was used
    • bodyAsJson

      public <R> R bodyAsJson(Class<R> type)
      Parameters:
      type -
      Returns:
      the response body decoded as the specified type with the Jackson mapper, or null if a codec other than was used
    • getHeader

      public String getHeader(CharSequence arg0)
      Specified by:
      getHeader in interface io.vertx.mutiny.core.http.HttpResponseHead
    • newInstance

      public static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse arg)
    • newInstance

      public static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse arg, io.smallrye.mutiny.vertx.TypeArg<T> __typeArg_T)