public interface ClientResponse
ExchangeFunction
.
Access to headers and body is offered by ClientResponse.Headers
and
body(BodyExtractor)
, bodyToMono(Class)
, bodyToFlux(Class)
respectively.Modifier and Type | Interface and Description |
---|---|
static interface |
ClientResponse.Headers
Represents the headers of the HTTP response.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
body(BodyExtractor<T,? super ClientHttpResponse> extractor)
Extract the body with the given
BodyExtractor . |
<T> <any> |
bodyToFlux(java.lang.Class<? extends T> elementClass)
Extract the body to a
Flux . |
<T> <any> |
bodyToMono(java.lang.Class<? extends T> elementClass)
Extract the body to a
Mono . |
MultiValueMap<java.lang.String,ResponseCookie> |
cookies()
Return cookies of this response.
|
ClientResponse.Headers |
headers()
Return the headers of this response.
|
HttpStatus |
statusCode()
Return the status code of this response.
|
HttpStatus statusCode()
ClientResponse.Headers headers()
MultiValueMap<java.lang.String,ResponseCookie> cookies()
<T> T body(BodyExtractor<T,? super ClientHttpResponse> extractor)
BodyExtractor
. Unlike bodyToMono(Class)
and
bodyToFlux(Class)
; this method does not check for a 4xx or 5xx status code before
extracting the body.T
- the type of the body returnedextractor
- the BodyExtractor
that reads from the response<T> <any> bodyToMono(java.lang.Class<? extends T> elementClass)
Mono
. If the response has status code 4xx or 5xx, the
Mono
will contain a WebClientException
.T
- the element typeelementClass
- the class of element in the Mono
WebClientException
if the status code is
4xx or 5xx<T> <any> bodyToFlux(java.lang.Class<? extends T> elementClass)
Flux
. If the response has status code 4xx or 5xx, the
Flux
will contain a WebClientException
.T
- the element typeelementClass
- the class of element in the Flux
WebClientException
if the status code is
4xx or 5xx