类 RestClientAdapter
java.lang.Object
cn.taketoday.web.client.support.RestClientAdapter
- 所有已实现的接口:
HttpExchangeAdapter
HttpExchangeAdapter that enables an HttpServiceProxyFactory
to use RestClient for request execution.
Use static factory methods in this class to create an
HttpServiceProxyFactory configured with the given RestClient.
- 从以下版本开始:
- 4.0
- 作者:
- Olga Maciaszek-Sharma, Rossen Stoyanchev, Harry Yang
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static RestClientAdaptercreate(RestClient restClient) Create aRestClientAdapterfor the givenRestClient.voidexchange(HttpRequestValues requestValues) Perform the given request, and release the response content, if any.Variant ofHttpExchangeAdapter.exchange(HttpRequestValues)with additional access to the response status and headers.<T> TexchangeForBody(HttpRequestValues values, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to the given type.<T> ResponseEntity<T>exchangeForEntity(HttpRequestValues values, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Variant ofHttpExchangeAdapter.exchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.exchangeForHeaders(HttpRequestValues values) Perform the given request, release the response content, and return the response headers.private RestClient.RequestBodySpecnewRequest(HttpRequestValues values) booleanWhether the underlying client supports use of request attributes.
-
字段详细资料
-
restClient
-
-
构造器详细资料
-
RestClientAdapter
-
-
方法详细资料
-
supportsRequestAttributes
public boolean supportsRequestAttributes()从接口复制的说明:HttpExchangeAdapterWhether the underlying client supports use of request attributes.- 指定者:
supportsRequestAttributes在接口中HttpExchangeAdapter
-
exchange
从接口复制的说明:HttpExchangeAdapterPerform the given request, and release the response content, if any.- 指定者:
exchange在接口中HttpExchangeAdapter- 参数:
requestValues- the request to perform
-
exchangeForHeaders
从接口复制的说明:HttpExchangeAdapterPerform the given request, release the response content, and return the response headers.- 指定者:
exchangeForHeaders在接口中HttpExchangeAdapter- 参数:
values- the request to perform- 返回:
- the response headers
-
exchangeForBody
public <T> T exchangeForBody(HttpRequestValues values, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) 从接口复制的说明:HttpExchangeAdapterPerform the given request and decode the response content to the given type.- 指定者:
exchangeForBody在接口中HttpExchangeAdapter- 类型参数:
T- the type the response is decoded to- 参数:
values- the request to performbodyType- the target type to decode to- 返回:
- the decoded response body.
-
exchangeForBodilessEntity
从接口复制的说明:HttpExchangeAdapterVariant ofHttpExchangeAdapter.exchange(HttpRequestValues)with additional access to the response status and headers.- 指定者:
exchangeForBodilessEntity在接口中HttpExchangeAdapter- 返回:
- the response entity with status and headers.
-
exchangeForEntity
public <T> ResponseEntity<T> exchangeForEntity(HttpRequestValues values, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) 从接口复制的说明:HttpExchangeAdapterVariant ofHttpExchangeAdapter.exchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- 指定者:
exchangeForEntity在接口中HttpExchangeAdapter- 返回:
- the response entity with status, headers, and body.
-
newRequest
-
create
Create aRestClientAdapterfor the givenRestClient.
-