public class ClientResponse extends Object
Make sure you call bodyToMono(Class), skipBody() or similar and actually consume the response
body. It is possible to use bodyToMono(Void.class) if the response is empty.
| Modifier and Type | Method and Description |
|---|---|
<T> Mono<T> |
bodyToMono(Class<T> responseType)
Read the response body and extract it to a single object according to the
responseType given. |
Mono<ClientException> |
createException()
Create a
ClientException based on the contents of this response. |
Mono<ByteBuf> |
getBody()
|
HttpClientResponse |
getHttpResponse()
Return the underlying
HttpClientResponse from where you can access the response headers, status and
context. |
Mono<Void> |
skipBody()
Consume and release the response body then return and empty
Mono. |
String |
toString() |
public HttpClientResponse getHttpResponse()
HttpClientResponse from where you can access the response headers, status and
context.HttpClientResponsepublic Mono<ByteBuf> getBody()
Mono of ByteBuf. If this Mono is cancelled, then
it will not be possible to consume the body again.public <T> Mono<T> bodyToMono(Class<T> responseType)
responseType given. If the
response has an HTTP error (status codes 4xx and 5xx) the produced object will be a ClientException.public Mono<ClientException> createException()
ClientException based on the contents of this response. This method will attempt to extract
an ErrorResponse from the body if possible.Mono of ClientException from this responsepublic Mono<Void> skipBody()
Mono.Mono indicating response body consumption and release