Class RestTemplateAdapter
java.lang.Object
org.springframework.web.client.support.RestTemplateAdapter
- All Implemented Interfaces:
HttpExchangeAdapter
@Deprecated(since="7.1",
forRemoval=true)
public final class RestTemplateAdapter
extends Object
implements HttpExchangeAdapter
Deprecated, for removal: This API element is subject to removal in a future version.
HttpExchangeAdapter that enables an HttpServiceProxyFactory
to use RestTemplate for request execution.
Use static factory methods in this class to create an
HttpServiceProxyFactory configured with the given RestTemplate.
- Since:
- 6.1
- Author:
- Olga Maciaszek-Sharma, Brian Clozel
-
Method Summary
Modifier and TypeMethodDescriptionstatic RestTemplateAdaptercreate(RestTemplate restTemplate) Deprecated, for removal: This API element is subject to removal in a future version.Create aRestTemplateAdapterfor the givenRestTemplate.voidexchange(HttpRequestValues values) Deprecated, for removal: This API element is subject to removal in a future version.Perform the given request, and release the response content, if any.Deprecated, for removal: This API element is subject to removal in a future version.Variant ofHttpExchangeAdapter.exchange(HttpRequestValues)with additional access to the response status and headers.<T> @Nullable TexchangeForBody(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Deprecated, for removal: This API element is subject to removal in a future version.Perform the given request and decode the response content to the given type.<T> ResponseEntity<T> exchangeForEntity(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Deprecated, for removal: This API element is subject to removal in a future version.Variant ofHttpExchangeAdapter.exchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.exchangeForHeaders(HttpRequestValues values) Deprecated, for removal: This API element is subject to removal in a future version.Perform the given request, release the response content, and return the response headers.booleanDeprecated, for removal: This API element is subject to removal in a future version.Whether the underlying client supports use of request attributes.
-
Method Details
-
supportsRequestAttributes
public boolean supportsRequestAttributes()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpExchangeAdapterWhether the underlying client supports use of request attributes.- Specified by:
supportsRequestAttributesin interfaceHttpExchangeAdapter
-
exchange
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpExchangeAdapterPerform the given request, and release the response content, if any.- Specified by:
exchangein interfaceHttpExchangeAdapter- Parameters:
values- the request to perform
-
exchangeForHeaders
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpExchangeAdapterPerform the given request, release the response content, and return the response headers.- Specified by:
exchangeForHeadersin interfaceHttpExchangeAdapter- Parameters:
values- the request to perform- Returns:
- the response headers
-
exchangeForBody
public <T> @Nullable T exchangeForBody(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpExchangeAdapterPerform the given request and decode the response content to the given type.- Specified by:
exchangeForBodyin interfaceHttpExchangeAdapter- Type Parameters:
T- the type the response is decoded to- Parameters:
values- the request to performbodyType- the target type to decode to- Returns:
- the decoded response body.
-
exchangeForBodilessEntity
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpExchangeAdapterVariant ofHttpExchangeAdapter.exchange(HttpRequestValues)with additional access to the response status and headers.- Specified by:
exchangeForBodilessEntityin interfaceHttpExchangeAdapter- Returns:
- the response entity with status and headers.
-
exchangeForEntity
public <T> ResponseEntity<T> exchangeForEntity(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpExchangeAdapterVariant ofHttpExchangeAdapter.exchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- Specified by:
exchangeForEntityin interfaceHttpExchangeAdapter- Returns:
- the response entity with status, headers, and body.
-
create
Deprecated, for removal: This API element is subject to removal in a future version.Create aRestTemplateAdapterfor the givenRestTemplate.
-
RestClientAdapter.