public interface HttpResponse<T> extends HttpHeaders
Modifier and Type | Interface and Description |
---|---|
static class |
HttpResponse.SupportedResponses |
Modifier and Type | Method and 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 original
HttpRequest that initiated this response. |
header, headers, headers
default boolean isSuccessful()
static boolean isSuccessful(int code)
int code()
default String message()
T body()
Closeable
, it should be closed by the caller.default String bodyString() throws IOException
InputStream
, it will be read as UTF-8.IOException
- in case there's an I/O problemHttpRequest request()
HttpRequest
that initiated this response.Optional<HttpResponse<?>> previousResponse()
Copyright © 2015–2023 Red Hat. All rights reserved.