SPR-5866 - RestTemplate - access to Request Headers
This commit is contained in:
parent
1d6f374970
commit
991c982e5b
|
|
@ -364,8 +364,8 @@ public interface RestOperations {
|
|||
* @return the response as entity
|
||||
* @since 3.0.2
|
||||
*/
|
||||
<Req, Res> HttpEntity<Res> exchange(String url, HttpMethod method, HttpEntity<Req> requestEntity,
|
||||
Class<Res> responseType, Object... uriVariables) throws RestClientException;
|
||||
<T> HttpEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestEntity,
|
||||
Class<T> responseType, Object... uriVariables) throws RestClientException;
|
||||
|
||||
/**
|
||||
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and
|
||||
|
|
@ -379,8 +379,8 @@ public interface RestOperations {
|
|||
* @return the response as entity
|
||||
* @since 3.0.2
|
||||
*/
|
||||
<Req, Res> HttpEntity<Res> exchange(String url, HttpMethod method, HttpEntity<Req> requestEntity,
|
||||
Class<Res> responseType, Map<String, ?> uriVariables) throws RestClientException;
|
||||
<T> HttpEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestEntity,
|
||||
Class<T> responseType, Map<String, ?> uriVariables) throws RestClientException;
|
||||
|
||||
/**
|
||||
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and
|
||||
|
|
@ -392,8 +392,8 @@ public interface RestOperations {
|
|||
* @return the response as entity
|
||||
* @since 3.0.2
|
||||
*/
|
||||
<Req, Res> HttpEntity<Res> exchange(URI url, HttpMethod method, HttpEntity<Req> requestEntity,
|
||||
Class<Res> responseType) throws RestClientException;
|
||||
<T> HttpEntity<T> exchange(URI url, HttpMethod method, HttpEntity<?> requestEntity,
|
||||
Class<T> responseType) throws RestClientException;
|
||||
|
||||
// general execution
|
||||
|
||||
|
|
|
|||
|
|
@ -363,24 +363,24 @@ public class RestTemplate extends HttpAccessor implements RestOperations {
|
|||
|
||||
// exchange
|
||||
|
||||
public <Req, Res> HttpEntity<Res> exchange(String url, HttpMethod method,
|
||||
HttpEntity<Req> requestEntity, Class<Res> responseType, Object... uriVariables) throws RestClientException {
|
||||
public <T> HttpEntity<T> exchange(String url, HttpMethod method,
|
||||
HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) throws RestClientException {
|
||||
HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(requestEntity, responseType);
|
||||
HttpEntityResponseExtractor<Res> responseExtractor = new HttpEntityResponseExtractor<Res>(responseType);
|
||||
HttpEntityResponseExtractor<T> responseExtractor = new HttpEntityResponseExtractor<T>(responseType);
|
||||
return execute(url, method, requestCallback, responseExtractor, uriVariables);
|
||||
}
|
||||
|
||||
public <Req, Res> HttpEntity<Res> exchange(String url, HttpMethod method,
|
||||
HttpEntity<Req> requestEntity, Class<Res> responseType, Map<String, ?> uriVariables) throws RestClientException {
|
||||
public <T> HttpEntity<T> exchange(String url, HttpMethod method,
|
||||
HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) throws RestClientException {
|
||||
HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(requestEntity, responseType);
|
||||
HttpEntityResponseExtractor<Res> responseExtractor = new HttpEntityResponseExtractor<Res>(responseType);
|
||||
HttpEntityResponseExtractor<T> responseExtractor = new HttpEntityResponseExtractor<T>(responseType);
|
||||
return execute(url, method, requestCallback, responseExtractor, uriVariables);
|
||||
}
|
||||
|
||||
public <Req, Res> HttpEntity<Res> exchange(URI url, HttpMethod method, HttpEntity<Req> requestEntity,
|
||||
Class<Res> responseType) throws RestClientException {
|
||||
public <T> HttpEntity<T> exchange(URI url, HttpMethod method, HttpEntity<?> requestEntity,
|
||||
Class<T> responseType) throws RestClientException {
|
||||
HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(requestEntity, responseType);
|
||||
HttpEntityResponseExtractor<Res> responseExtractor = new HttpEntityResponseExtractor<Res>(responseType);
|
||||
HttpEntityResponseExtractor<T> responseExtractor = new HttpEntityResponseExtractor<T>(responseType);
|
||||
return execute(url, method, requestCallback, responseExtractor);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue