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

    Modifier and Type
    Method
    Description
    Get the response body.
    <T> T
    getBody(Class<T> expectedType)
    Get the response body, casting it into the expected type.
    Get the error exception, if present.
    Get the response headers.
    int
    Get the response code.
    default boolean
    Returns whether or not the request had an error (4xx/5xx response code or underlying IOException)
  • Method Details

    • getBody

      InputStream getBody()
      Get the response body.
    • getBody

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

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

      int getStatusCode()
      Get the response code.
    • getHeaders

      @Nonnull Map<String,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)