Interface HttpResponse<T>
-
- All Superinterfaces:
HttpHeaders
- All Known Implementing Classes:
WebSocketUpgradeResponse
public interface HttpResponse<T> extends HttpHeaders
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classHttpResponse.SupportedResponses
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Tbody()Get the body.default StringbodyString()Return the body as a String.intcode()Returns the HTTP status code.default booleanisSuccessful()static booleanisSuccessful(int code)default Stringmessage()Optional<HttpResponse<?>>previousResponse()HttpRequestrequest()The originalHttpRequestthat initiated this response.-
Methods inherited from interface io.fabric8.kubernetes.client.http.HttpHeaders
header, headers, headers
-
-
-
-
Method Detail
-
isSuccessful
default boolean isSuccessful()
-
isSuccessful
static boolean isSuccessful(int code)
-
code
int code()
Returns the HTTP status code.- Returns:
- the HTTP status code.
-
message
default String message()
-
body
T body()
Get the body. If the body isCloseable, it should be closed by the caller.- Returns:
- the body
-
bodyString
default String bodyString() throws IOException
Return the body as a String. Or an empty String if there was no body (possibly discarded).
If the body is anInputStream, it will be read as UTF-8.- Returns:
- the body
- Throws:
IOException- in case there's an I/O problem
-
request
HttpRequest request()
The originalHttpRequestthat initiated this response.- Returns:
- the HTTP request.
-
previousResponse
Optional<HttpResponse<?>> previousResponse()
-
-