接口 HttpExchangeAdapter

所有已知子接口:
ReactorHttpExchangeAdapter
所有已知实现类:
AbstractReactorHttpExchangeAdapter, RestClientAdapter, RestTemplateAdapter, WebClientAdapter

public interface HttpExchangeAdapter
Contract to abstract an HTTP client from HttpServiceProxyFactory and make it pluggable.

For reactive clients, see ReactorHttpExchangeAdapter.

从以下版本开始:
4.0
作者:
Rossen Stoyanchev, Harry Yang
  • 方法详细资料

    • supportsRequestAttributes

      boolean supportsRequestAttributes()
      Whether the underlying client supports use of request attributes.
    • exchange

      void exchange(HttpRequestValues requestValues)
      Perform the given request, and release the response content, if any.
      参数:
      requestValues - the request to perform
    • exchangeForHeaders

      HttpHeaders exchangeForHeaders(HttpRequestValues requestValues)
      Perform the given request, release the response content, and return the response headers.
      参数:
      requestValues - the request to perform
      返回:
      the response headers
    • exchangeForBody

      @Nullable <T> T exchangeForBody(HttpRequestValues requestValues, cn.taketoday.core.ParameterizedTypeReference<T> bodyType)
      Perform the given request and decode the response content to the given type.
      类型参数:
      T - the type the response is decoded to
      参数:
      requestValues - the request to perform
      bodyType - the target type to decode to
      返回:
      the decoded response body.
    • exchangeForBodilessEntity

      ResponseEntity<Void> exchangeForBodilessEntity(HttpRequestValues requestValues)
      Variant of exchange(HttpRequestValues) with additional access to the response status and headers.
      返回:
      the response entity with status and headers.
    • exchangeForEntity

      <T> ResponseEntity<T> exchangeForEntity(HttpRequestValues requestValues, cn.taketoday.core.ParameterizedTypeReference<T> bodyType)
      Variant of exchangeForBody(HttpRequestValues, ParameterizedTypeReference) with additional access to the response status and headers.
      返回:
      the response entity with status, headers, and body.