Interface Response
-
@Beta public interface ResponseHTTP Response wrapper.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.io.InputStreamgetBody()Get the response body.<T> TgetBody(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.intgetStatusCode()Get the response code.default booleanisError()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)
-
-