接口 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
-
方法概要
修饰符和类型方法说明voidexchange(HttpRequestValues requestValues) Perform the given request, and release the response content, if any.exchangeForBodilessEntity(HttpRequestValues requestValues) Variant ofexchange(HttpRequestValues)with additional access to the response status and headers.<T> TexchangeForBody(HttpRequestValues requestValues, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to the given type.<T> ResponseEntity<T>exchangeForEntity(HttpRequestValues requestValues, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Variant ofexchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.exchangeForHeaders(HttpRequestValues requestValues) Perform the given request, release the response content, and return the response headers.booleanWhether the underlying client supports use of request attributes.
-
方法详细资料
-
supportsRequestAttributes
boolean supportsRequestAttributes()Whether the underlying client supports use of request attributes. -
exchange
Perform the given request, and release the response content, if any.- 参数:
requestValues- the request to perform
-
exchangeForHeaders
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 performbodyType- the target type to decode to- 返回:
- the decoded response body.
-
exchangeForBodilessEntity
Variant ofexchange(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 ofexchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- 返回:
- the response entity with status, headers, and body.
-