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 class
HttpResponse.SupportedResponses
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
body()
Get the body.default String
bodyString()
Return the body as a String.int
code()
Returns the HTTP status code.default boolean
isSuccessful()
static boolean
isSuccessful(int code)
default String
message()
Optional<HttpResponse<?>>
previousResponse()
HttpRequest
request()
The originalHttpRequest
that 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 originalHttpRequest
that initiated this response.- Returns:
- the HTTP request.
-
previousResponse
Optional<HttpResponse<?>> previousResponse()
-
-