Interface Response


  • @Beta
    public interface Response
    HTTP Response wrapper.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.io.InputStream getBody()
      Get the response body.
      <T> T getBody​(java.lang.Class<T> expectedType)
      Get the response body, casting it into the expected type.
      java.util.Optional<java.lang.Exception> getException()
      Get the error exception, if present.
      java.util.Map<java.lang.String,​java.lang.String> getHeaders()
      Get the response headers.
      int getStatusCode()
      Get the response code.
      default boolean isError()
      Returns whether or not the request had an error (4xx/5xx response code or underlying IOException)
    • Method Detail

      • getBody

        java.io.InputStream getBody()
        Get the response body.
      • getBody

        <T> T getBody​(@Nonnull
                      java.lang.Class<T> expectedType)
        Get the response body, casting it into the expected type.
      • getException

        @Nonnull
        java.util.Optional<java.lang.Exception> getException()
        Get the error exception, if present.
      • getStatusCode

        int getStatusCode()
        Get the response code.
      • getHeaders

        @Nonnull
        java.util.Map<java.lang.String,​java.lang.String> getHeaders()
        Get the response headers.
      • isError

        default boolean isError()
        Returns whether or not the request had an error (4xx/5xx response code or underlying IOException)