WebClient
@Deprecated public interface AsyncRestOperations
AsyncRestTemplate
. Not often used directly, but a useful
option to enhance testability, as it can easily be mocked or stubbed.AsyncRestTemplate
,
RestOperations
Modifier and Type | Method and Description |
---|---|
ListenableFuture<?> |
delete(String url,
Map<String,?> uriVariables)
Deprecated.
Asynchronously delete the resources at the specified URI.
|
ListenableFuture<?> |
delete(String url,
Object... uriVariables)
Deprecated.
Asynchronously delete the resources at the specified URI.
|
ListenableFuture<?> |
delete(URI url)
Deprecated.
Asynchronously delete the resources at the specified URI.
|
<T> ListenableFuture<ResponseEntity<T>> |
exchange(String url,
HttpMethod method,
HttpEntity<?> requestEntity,
Class<T> responseType,
Map<String,?> uriVariables)
Deprecated.
Asynchronously execute the HTTP method to the given URI template, writing the
given request entity to the request, and returns the response as
ResponseEntity . |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(String url,
HttpMethod method,
HttpEntity<?> requestEntity,
Class<T> responseType,
Object... uriVariables)
Deprecated.
Asynchronously execute the HTTP method to the given URI template, writing the
given request entity to the request, and returns the response as
ResponseEntity . |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(String url,
HttpMethod method,
HttpEntity<?> requestEntity,
ParameterizedTypeReference<T> responseType,
Map<String,?> uriVariables)
Deprecated.
Asynchronously execute the HTTP method to the given URI template, writing the given
request entity to the request, and returns the response as
ResponseEntity . |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(String url,
HttpMethod method,
HttpEntity<?> requestEntity,
ParameterizedTypeReference<T> responseType,
Object... uriVariables)
Deprecated.
Asynchronously execute the HTTP method to the given URI template, writing the given
request entity to the request, and returns the response as
ResponseEntity . |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(URI url,
HttpMethod method,
HttpEntity<?> requestEntity,
Class<T> responseType)
Deprecated.
Asynchronously execute the HTTP method to the given URI template, writing the
given request entity to the request, and returns the response as
ResponseEntity . |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(URI url,
HttpMethod method,
HttpEntity<?> requestEntity,
ParameterizedTypeReference<T> responseType)
Deprecated.
Asynchronously execute the HTTP method to the given URI template, writing the given
request entity to the request, and returns the response as
ResponseEntity . |
<T> ListenableFuture<T> |
execute(String url,
HttpMethod method,
AsyncRequestCallback requestCallback,
ResponseExtractor<T> responseExtractor,
Map<String,?> uriVariables)
Deprecated.
Asynchronously execute the HTTP method to the given URI template, preparing the
request with the
AsyncRequestCallback , and reading the response with a
ResponseExtractor . |
<T> ListenableFuture<T> |
execute(String url,
HttpMethod method,
AsyncRequestCallback requestCallback,
ResponseExtractor<T> responseExtractor,
Object... uriVariables)
Deprecated.
Asynchronously execute the HTTP method to the given URI template, preparing the
request with the
AsyncRequestCallback , and reading the response with a
ResponseExtractor . |
<T> ListenableFuture<T> |
execute(URI url,
HttpMethod method,
AsyncRequestCallback requestCallback,
ResponseExtractor<T> responseExtractor)
Deprecated.
Asynchronously execute the HTTP method to the given URL, preparing the request
with the
AsyncRequestCallback , and reading the response with a
ResponseExtractor . |
<T> ListenableFuture<ResponseEntity<T>> |
getForEntity(String url,
Class<T> responseType,
Map<String,?> uriVariables)
Deprecated.
Asynchronously retrieve a representation by doing a GET on the URI template.
|
<T> ListenableFuture<ResponseEntity<T>> |
getForEntity(String url,
Class<T> responseType,
Object... uriVariables)
Deprecated.
Asynchronously retrieve an entity by doing a GET on the specified URL.
|
<T> ListenableFuture<ResponseEntity<T>> |
getForEntity(URI url,
Class<T> responseType)
Deprecated.
Asynchronously retrieve a representation by doing a GET on the URL.
|
RestOperations |
getRestOperations()
Deprecated.
Expose the synchronous Spring RestTemplate to allow synchronous invocation.
|
ListenableFuture<HttpHeaders> |
headForHeaders(String url,
Map<String,?> uriVariables)
Deprecated.
Asynchronously retrieve all headers of the resource specified by the URI template.
|
ListenableFuture<HttpHeaders> |
headForHeaders(String url,
Object... uriVariables)
Deprecated.
Asynchronously retrieve all headers of the resource specified by the URI template.
|
ListenableFuture<HttpHeaders> |
headForHeaders(URI url)
Deprecated.
Asynchronously retrieve all headers of the resource specified by the URL.
|
ListenableFuture<Set<HttpMethod>> |
optionsForAllow(String url,
Map<String,?> uriVariables)
Deprecated.
Asynchronously return the value of the Allow header for the given URI.
|
ListenableFuture<Set<HttpMethod>> |
optionsForAllow(String url,
Object... uriVariables)
Deprecated.
Asynchronously return the value of the Allow header for the given URI.
|
ListenableFuture<Set<HttpMethod>> |
optionsForAllow(URI url)
Deprecated.
Asynchronously return the value of the Allow header for the given URL.
|
<T> ListenableFuture<ResponseEntity<T>> |
postForEntity(String url,
HttpEntity<?> request,
Class<T> responseType,
Map<String,?> uriVariables)
Deprecated.
Create a new resource by POSTing the given object to the URI template,
and asynchronously returns the response as
ResponseEntity . |
<T> ListenableFuture<ResponseEntity<T>> |
postForEntity(String url,
HttpEntity<?> request,
Class<T> responseType,
Object... uriVariables)
Deprecated.
Create a new resource by POSTing the given object to the URI template,
and asynchronously returns the response as
ResponseEntity . |
<T> ListenableFuture<ResponseEntity<T>> |
postForEntity(URI url,
HttpEntity<?> request,
Class<T> responseType)
Deprecated.
Create a new resource by POSTing the given object to the URL,
and asynchronously returns the response as
ResponseEntity . |
ListenableFuture<URI> |
postForLocation(String url,
HttpEntity<?> request,
Map<String,?> uriVariables)
Deprecated.
Create a new resource by POSTing the given object to the URI template, and
asynchronously returns the value of the
Location header. |
ListenableFuture<URI> |
postForLocation(String url,
HttpEntity<?> request,
Object... uriVariables)
Deprecated.
Create a new resource by POSTing the given object to the URI template, and
asynchronously returns the value of the
Location header. |
ListenableFuture<URI> |
postForLocation(URI url,
HttpEntity<?> request)
Deprecated.
Create a new resource by POSTing the given object to the URL, and asynchronously
returns the value of the
Location header. |
ListenableFuture<?> |
put(String url,
HttpEntity<?> request,
Map<String,?> uriVariables)
Deprecated.
Creates a new resource by PUTting the given object to URI template.
|
ListenableFuture<?> |
put(String url,
HttpEntity<?> request,
Object... uriVariables)
Deprecated.
Create or update a resource by PUTting the given object to the URI.
|
ListenableFuture<?> |
put(URI url,
HttpEntity<?> request)
Deprecated.
Creates a new resource by PUTting the given object to URL.
|
RestOperations getRestOperations()
<T> ListenableFuture<ResponseEntity<T>> getForEntity(String url, Class<T> responseType, Object... uriVariables) throws RestClientException
ResponseEntity
.
URI Template variables are expanded using the given URI variables, if any.
url
- the URLresponseType
- the type of the return valueuriVariables
- the variables to expand the templateFuture
RestClientException
<T> ListenableFuture<ResponseEntity<T>> getForEntity(String url, Class<T> responseType, Map<String,?> uriVariables) throws RestClientException
ResponseEntity
.
URI Template variables are expanded using the given map.
url
- the URLresponseType
- the type of the return valueuriVariables
- the map containing variables for the URI templateFuture
RestClientException
<T> ListenableFuture<ResponseEntity<T>> getForEntity(URI url, Class<T> responseType) throws RestClientException
ResponseEntity
.url
- the URLresponseType
- the type of the return valueFuture
RestClientException
ListenableFuture<HttpHeaders> headForHeaders(String url, Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
url
- the URLuriVariables
- the variables to expand the templateFuture
RestClientException
ListenableFuture<HttpHeaders> headForHeaders(String url, Map<String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
url
- the URLuriVariables
- the map containing variables for the URI templateFuture
RestClientException
ListenableFuture<HttpHeaders> headForHeaders(URI url) throws RestClientException
url
- the URLFuture
RestClientException
ListenableFuture<URI> postForLocation(String url, @Nullable HttpEntity<?> request, Object... uriVariables) throws RestClientException
Location
header. This header
typically indicates where the new resource is stored.
URI Template variables are expanded using the given URI variables, if any.
url
- the URLrequest
- the Object to be POSTed (may be null
)uriVariables
- the variables to expand the templateLocation
header wrapped in a Future
RestClientException
HttpEntity
ListenableFuture<URI> postForLocation(String url, @Nullable HttpEntity<?> request, Map<String,?> uriVariables) throws RestClientException
Location
header. This header
typically indicates where the new resource is stored.
URI Template variables are expanded using the given map.
url
- the URLrequest
- the Object to be POSTed (may be null
)uriVariables
- the variables to expand the templateLocation
header wrapped in a Future
RestClientException
HttpEntity
ListenableFuture<URI> postForLocation(URI url, @Nullable HttpEntity<?> request) throws RestClientException
Location
header. This header typically indicates
where the new resource is stored.url
- the URLrequest
- the Object to be POSTed (may be null
)Location
header wrapped in a Future
RestClientException
HttpEntity
<T> ListenableFuture<ResponseEntity<T>> postForEntity(String url, @Nullable HttpEntity<?> request, Class<T> responseType, Object... uriVariables) throws RestClientException
ResponseEntity
.
URI Template variables are expanded using the given URI variables, if any.
url
- the URLrequest
- the Object to be POSTed (may be null
)uriVariables
- the variables to expand the templateFuture
RestClientException
HttpEntity
<T> ListenableFuture<ResponseEntity<T>> postForEntity(String url, @Nullable HttpEntity<?> request, Class<T> responseType, Map<String,?> uriVariables) throws RestClientException
ResponseEntity
.
URI Template variables are expanded using the given map.
url
- the URLrequest
- the Object to be POSTed (may be null
)uriVariables
- the variables to expand the templateFuture
RestClientException
HttpEntity
<T> ListenableFuture<ResponseEntity<T>> postForEntity(URI url, @Nullable HttpEntity<?> request, Class<T> responseType) throws RestClientException
ResponseEntity
.url
- the URLrequest
- the Object to be POSTed (may be null
)Future
RestClientException
HttpEntity
ListenableFuture<?> put(String url, @Nullable HttpEntity<?> request, Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
The Future will return a null
result upon completion.
url
- the URLrequest
- the Object to be PUT (may be null
)uriVariables
- the variables to expand the templateRestClientException
HttpEntity
ListenableFuture<?> put(String url, @Nullable HttpEntity<?> request, Map<String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
The Future will return a null
result upon completion.
url
- the URLrequest
- the Object to be PUT (may be null
)uriVariables
- the variables to expand the templateRestClientException
HttpEntity
ListenableFuture<?> put(URI url, @Nullable HttpEntity<?> request) throws RestClientException
The Future will return a null
result upon completion.
url
- the URLrequest
- the Object to be PUT (may be null
)RestClientException
HttpEntity
ListenableFuture<?> delete(String url, Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
The Future will return a null
result upon completion.
url
- the URLuriVariables
- the variables to expand in the templateRestClientException
ListenableFuture<?> delete(String url, Map<String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
The Future will return a null
result upon completion.
url
- the URLuriVariables
- the variables to expand in the templateRestClientException
ListenableFuture<?> delete(URI url) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
The Future will return a null
result upon completion.
url
- the URLRestClientException
ListenableFuture<Set<HttpMethod>> optionsForAllow(String url, Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
url
- the URLuriVariables
- the variables to expand in the templateFuture
RestClientException
ListenableFuture<Set<HttpMethod>> optionsForAllow(String url, Map<String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
url
- the URLuriVariables
- the variables to expand in the templateFuture
RestClientException
ListenableFuture<Set<HttpMethod>> optionsForAllow(URI url) throws RestClientException
url
- the URLFuture
RestClientException
<T> ListenableFuture<ResponseEntity<T>> exchange(String url, HttpMethod method, @Nullable HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) throws RestClientException
ResponseEntity
.
URI Template variables are expanded using the given URI variables, if any.
url
- the URLmethod
- the HTTP method (GET, POST, etc)requestEntity
- the entity (headers and/or body) to write to the request
(may be null
)responseType
- the type of the return valueuriVariables
- the variables to expand in the templateFuture
RestClientException
<T> ListenableFuture<ResponseEntity<T>> exchange(String url, HttpMethod method, @Nullable HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables) throws RestClientException
ResponseEntity
.
URI Template variables are expanded using the given URI variables, if any.
url
- the URLmethod
- the HTTP method (GET, POST, etc)requestEntity
- the entity (headers and/or body) to write to the request
(may be null
)responseType
- the type of the return valueuriVariables
- the variables to expand in the templateFuture
RestClientException
<T> ListenableFuture<ResponseEntity<T>> exchange(URI url, HttpMethod method, @Nullable HttpEntity<?> requestEntity, Class<T> responseType) throws RestClientException
ResponseEntity
.url
- the URLmethod
- the HTTP method (GET, POST, etc)requestEntity
- the entity (headers and/or body) to write to the request
(may be null
)responseType
- the type of the return valueFuture
RestClientException
<T> ListenableFuture<ResponseEntity<T>> exchange(String url, HttpMethod method, @Nullable HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, Object... uriVariables) throws RestClientException
ResponseEntity
.
The given ParameterizedTypeReference
is used to pass generic type
information:
ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {}; ResponseEntity<List<MyBean>> response = template.exchange("https://example.com",HttpMethod.GET, null, myBean);
url
- the URLmethod
- the HTTP method (GET, POST, etc)requestEntity
- the entity (headers and/or body) to write to the
request (may be null
)responseType
- the type of the return valueuriVariables
- the variables to expand in the templateFuture
RestClientException
<T> ListenableFuture<ResponseEntity<T>> exchange(String url, HttpMethod method, @Nullable HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, Map<String,?> uriVariables) throws RestClientException
ResponseEntity
.
The given ParameterizedTypeReference
is used to pass generic type
information:
ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {}; ResponseEntity<List<MyBean>> response = template.exchange("https://example.com",HttpMethod.GET, null, myBean);
url
- the URLmethod
- the HTTP method (GET, POST, etc)requestEntity
- the entity (headers and/or body) to write to the request
(may be null
)responseType
- the type of the return valueuriVariables
- the variables to expand in the templateFuture
RestClientException
<T> ListenableFuture<ResponseEntity<T>> exchange(URI url, HttpMethod method, @Nullable HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType) throws RestClientException
ResponseEntity
.
The given ParameterizedTypeReference
is used to pass generic type
information:
ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {}; ResponseEntity<List<MyBean>> response = template.exchange("https://example.com",HttpMethod.GET, null, myBean);
url
- the URLmethod
- the HTTP method (GET, POST, etc)requestEntity
- the entity (headers and/or body) to write to the request
(may be null
)responseType
- the type of the return valueFuture
RestClientException
<T> ListenableFuture<T> execute(String url, HttpMethod method, @Nullable AsyncRequestCallback requestCallback, @Nullable ResponseExtractor<T> responseExtractor, Object... uriVariables) throws RestClientException
AsyncRequestCallback
, and reading the response with a
ResponseExtractor
.
URI Template variables are expanded using the given URI variables, if any.
url
- the URLmethod
- the HTTP method (GET, POST, etc)requestCallback
- object that prepares the requestresponseExtractor
- object that extracts the return value from the responseuriVariables
- the variables to expand in the templateResponseExtractor
RestClientException
<T> ListenableFuture<T> execute(String url, HttpMethod method, @Nullable AsyncRequestCallback requestCallback, @Nullable ResponseExtractor<T> responseExtractor, Map<String,?> uriVariables) throws RestClientException
AsyncRequestCallback
, and reading the response with a
ResponseExtractor
.
URI Template variables are expanded using the given URI variables map.
url
- the URLmethod
- the HTTP method (GET, POST, etc)requestCallback
- object that prepares the requestresponseExtractor
- object that extracts the return value from the responseuriVariables
- the variables to expand in the templateResponseExtractor
RestClientException
<T> ListenableFuture<T> execute(URI url, HttpMethod method, @Nullable AsyncRequestCallback requestCallback, @Nullable ResponseExtractor<T> responseExtractor) throws RestClientException
AsyncRequestCallback
, and reading the response with a
ResponseExtractor
.url
- the URLmethod
- the HTTP method (GET, POST, etc)requestCallback
- object that prepares the requestresponseExtractor
- object that extracts the return value from the responseResponseExtractor
RestClientException