类 ClientResponseWrapper

java.lang.Object
cn.taketoday.web.reactive.function.client.support.ClientResponseWrapper
所有已实现的接口:
ClientResponse

public class ClientResponseWrapper extends Object implements ClientResponse
Implementation of the ClientResponse interface that can be subclassed to adapt the request in a exchange filter function. All methods default to calling through to the wrapped request.
从以下版本开始:
4.0
作者:
Arjen Poutsma
  • 字段详细资料

  • 构造器详细资料

    • ClientResponseWrapper

      public ClientResponseWrapper(ClientResponse delegate)
      Create a new ClientResponseWrapper that wraps the given response.
      参数:
      delegate - the response to wrap
  • 方法详细资料

    • response

      public ClientResponse response()
      Return the wrapped request.
    • strategies

      public ExchangeStrategies strategies()
      从接口复制的说明: ClientResponse
      Return the strategies used to convert the body of this response.
      指定者:
      strategies 在接口中 ClientResponse
    • statusCode

      public HttpStatusCode statusCode()
      从接口复制的说明: ClientResponse
      Return the HTTP status code as an HttpStatusCode value.
      指定者:
      statusCode 在接口中 ClientResponse
      返回:
      the HTTP status as an HttpStatusCode value (never null)
    • rawStatusCode

      public int rawStatusCode()
      从接口复制的说明: ClientResponse
      Return the (potentially non-standard) status code of this response.
      指定者:
      rawStatusCode 在接口中 ClientResponse
      返回:
      the HTTP status as an integer value
      另请参阅:
    • headers

      public ClientResponse.Headers headers()
      从接口复制的说明: ClientResponse
      Return the headers of this response.
      指定者:
      headers 在接口中 ClientResponse
    • cookies

      public cn.taketoday.util.MultiValueMap<String,ResponseCookie> cookies()
      从接口复制的说明: ClientResponse
      Return the cookies of this response.
      指定者:
      cookies 在接口中 ClientResponse
    • body

      public <T> T body(BodyExtractor<T,? super ClientHttpResponse> extractor)
      从接口复制的说明: ClientResponse
      Extract the body with the given BodyExtractor.
      指定者:
      body 在接口中 ClientResponse
      类型参数:
      T - the type of the body returned
      参数:
      extractor - the BodyExtractor that reads from the response
      返回:
      the extracted body
    • bodyToMono

      public <T> reactor.core.publisher.Mono<T> bodyToMono(Class<? extends T> elementClass)
      从接口复制的说明: ClientResponse
      Extract the body to a Mono.
      指定者:
      bodyToMono 在接口中 ClientResponse
      类型参数:
      T - the element type
      参数:
      elementClass - the class of element in the Mono
      返回:
      a mono containing the body of the given type T
    • bodyToMono

      public <T> reactor.core.publisher.Mono<T> bodyToMono(cn.taketoday.core.ParameterizedTypeReference<T> elementTypeRef)
      从接口复制的说明: ClientResponse
      Extract the body to a Mono.
      指定者:
      bodyToMono 在接口中 ClientResponse
      类型参数:
      T - the element type
      参数:
      elementTypeRef - the type reference of element in the Mono
      返回:
      a mono containing the body of the given type T
    • bodyToFlux

      public <T> reactor.core.publisher.Flux<T> bodyToFlux(Class<? extends T> elementClass)
      从接口复制的说明: ClientResponse
      Extract the body to a Flux.
      指定者:
      bodyToFlux 在接口中 ClientResponse
      类型参数:
      T - the element type
      参数:
      elementClass - the class of elements in the Flux
      返回:
      a flux containing the body of the given type T
    • bodyToFlux

      public <T> reactor.core.publisher.Flux<T> bodyToFlux(cn.taketoday.core.ParameterizedTypeReference<T> elementTypeRef)
      从接口复制的说明: ClientResponse
      Extract the body to a Flux.
      指定者:
      bodyToFlux 在接口中 ClientResponse
      类型参数:
      T - the element type
      参数:
      elementTypeRef - the type reference of elements in the Flux
      返回:
      a flux containing the body of the given type T
    • releaseBody

      public reactor.core.publisher.Mono<Void> releaseBody()
      从接口复制的说明: ClientResponse
      Release the body of this response.
      指定者:
      releaseBody 在接口中 ClientResponse
      返回:
      a completion signal
      另请参阅:
      • DataBufferUtils.release(DataBuffer)
    • toBodilessEntity

      public reactor.core.publisher.Mono<ResponseEntity<Void>> toBodilessEntity()
      从接口复制的说明: ClientResponse
      Return this response as a delayed ResponseEntity containing status and headers, but no body. Calling this method will release the body of the response.
      指定者:
      toBodilessEntity 在接口中 ClientResponse
      返回:
      Mono with the bodiless ResponseEntity
    • toEntity

      public <T> reactor.core.publisher.Mono<ResponseEntity<T>> toEntity(Class<T> bodyType)
      从接口复制的说明: ClientResponse
      Return this response as a delayed ResponseEntity.
      指定者:
      toEntity 在接口中 ClientResponse
      类型参数:
      T - response body type
      参数:
      bodyType - the expected response body type
      返回:
      Mono with the ResponseEntity
    • toEntity

      public <T> reactor.core.publisher.Mono<ResponseEntity<T>> toEntity(cn.taketoday.core.ParameterizedTypeReference<T> bodyTypeReference)
      从接口复制的说明: ClientResponse
      Return this response as a delayed ResponseEntity.
      指定者:
      toEntity 在接口中 ClientResponse
      类型参数:
      T - response body type
      参数:
      bodyTypeReference - a type reference describing the expected response body type
      返回:
      Mono with the ResponseEntity
    • toEntityList

      public <T> reactor.core.publisher.Mono<ResponseEntity<List<T>>> toEntityList(Class<T> elementClass)
      从接口复制的说明: ClientResponse
      Return this response as a delayed list of ResponseEntitys.
      指定者:
      toEntityList 在接口中 ClientResponse
      类型参数:
      T - the type of elements in the list
      参数:
      elementClass - the expected response body list element class
      返回:
      Mono with the list of ResponseEntitys
    • toEntityList

      public <T> reactor.core.publisher.Mono<ResponseEntity<List<T>>> toEntityList(cn.taketoday.core.ParameterizedTypeReference<T> elementTypeRef)
      从接口复制的说明: ClientResponse
      Return this response as a delayed list of ResponseEntitys.
      指定者:
      toEntityList 在接口中 ClientResponse
      类型参数:
      T - the type of elements in the list
      参数:
      elementTypeRef - the expected response body list element reference type
      返回:
      Mono with the list of ResponseEntitys
    • createException

      public reactor.core.publisher.Mono<WebClientResponseException> createException()
      从接口复制的说明: ClientResponse
      Create a WebClientResponseException that contains the response status, headers, body, and the originating request.
      指定者:
      createException 在接口中 ClientResponse
      返回:
      a Mono with the created exception
    • createError

      public <T> reactor.core.publisher.Mono<T> createError()
      从接口复制的说明: ClientResponse
      Create a Mono that terminates with a WebClientResponseException, containing the response status, headers, body, and the originating request.
      指定者:
      createError 在接口中 ClientResponse
      类型参数:
      T - the reified type
      返回:
      a Mono that fails with a WebClientResponseException.
      另请参阅:
    • logPrefix

      public String logPrefix()
      从接口复制的说明: ClientResponse
      Return a log message prefix to use to correlate messages for this exchange.

      The prefix is based on ClientRequest.logPrefix(), which itself is based on the value of the LOG_ID_ATTRIBUTE request attribute, further surrounded with "[" and "]".

      指定者:
      logPrefix 在接口中 ClientResponse
      返回:
      the log message prefix or an empty String if the LOG_ID_ATTRIBUTE is not set