23
23
import org .springframework .http .HttpEntity ;
24
24
import org .springframework .http .HttpHeaders ;
25
25
import org .springframework .http .HttpMethod ;
26
+ import org .springframework .http .ResponseEntity ;
26
27
27
28
/**
28
29
* Interface specifying a basic set of RESTful operations. Implemented by {@link RestTemplate}.
@@ -71,37 +72,37 @@ public interface RestOperations {
71
72
72
73
/**
73
74
* Retrieve an entity by doing a GET on the specified URL.
74
- * The response is converted and stored in an {@link HttpEntity }.
75
+ * The response is converted and stored in an {@link ResponseEntity }.
75
76
* <p>URI Template variables are expanded using the given URI variables, if any.
76
77
* @param url the URL
77
78
* @param responseType the type of the return value
78
79
* @param uriVariables the variables to expand the template
79
80
* @return the entity
80
81
* @since 3.0.2
81
82
*/
82
- <T > HttpEntity <T > getForEntity (String url , Class <T > responseType , Object ... uriVariables ) throws RestClientException ;
83
+ <T > ResponseEntity <T > getForEntity (String url , Class <T > responseType , Object ... uriVariables ) throws RestClientException ;
83
84
84
85
/**
85
86
* Retrieve a representation by doing a GET on the URI template.
86
- * The response is converted and stored in an {@link HttpEntity }.
87
+ * The response is converted and stored in an {@link ResponseEntity }.
87
88
* <p>URI Template variables are expanded using the given map.
88
89
* @param url the URL
89
90
* @param responseType the type of the return value
90
91
* @param uriVariables the map containing variables for the URI template
91
92
* @return the converted object
92
93
* @since 3.0.2
93
94
*/
94
- <T > HttpEntity <T > getForEntity (String url , Class <T > responseType , Map <String , ?> uriVariables ) throws RestClientException ;
95
+ <T > ResponseEntity <T > getForEntity (String url , Class <T > responseType , Map <String , ?> uriVariables ) throws RestClientException ;
95
96
96
97
/**
97
98
* Retrieve a representation by doing a GET on the URL .
98
- * The response is converted and stored in an {@link HttpEntity }.
99
+ * The response is converted and stored in an {@link ResponseEntity }.
99
100
* @param url the URL
100
101
* @param responseType the type of the return value
101
102
* @return the converted object
102
103
* @since 3.0.2
103
104
*/
104
- <T > HttpEntity <T > getForEntity (URI url , Class <T > responseType ) throws RestClientException ;
105
+ <T > ResponseEntity <T > getForEntity (URI url , Class <T > responseType ) throws RestClientException ;
105
106
106
107
// HEAD
107
108
@@ -219,7 +220,7 @@ <T> T postForObject(String url, Object request, Class<T> responseType, Map<Strin
219
220
220
221
/**
221
222
* Create a new resource by POSTing the given object to the URI template,
222
- * and returns the response as {@link HttpEntity }.
223
+ * and returns the response as {@link ResponseEntity }.
223
224
* <p>URI Template variables are expanded using the given URI variables, if any.
224
225
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
225
226
* add additional HTTP headers to the request.
@@ -230,7 +231,7 @@ <T> T postForObject(String url, Object request, Class<T> responseType, Map<Strin
230
231
* @see HttpEntity
231
232
* @since 3.0.2
232
233
*/
233
- <T > HttpEntity <T > postForEntity (String url , Object request , Class <T > responseType , Object ... uriVariables )
234
+ <T > ResponseEntity <T > postForEntity (String url , Object request , Class <T > responseType , Object ... uriVariables )
234
235
throws RestClientException ;
235
236
236
237
/**
@@ -251,7 +252,7 @@ <T> HttpEntity<T> postForEntity(String url, Object request, Class<T> responseTyp
251
252
252
253
/**
253
254
* Create a new resource by POSTing the given object to the URL,
254
- * and returns the response as {@link HttpEntity }.
255
+ * and returns the response as {@link ResponseEntity }.
255
256
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
256
257
* add additional HTTP headers to the request.
257
258
* @param url the URL
@@ -260,7 +261,7 @@ <T> HttpEntity<T> postForEntity(String url, Object request, Class<T> responseTyp
260
261
* @see HttpEntity
261
262
* @since 3.0.2
262
263
*/
263
- <T > HttpEntity <T > postForEntity (URI url , Object request , Class <T > responseType ) throws RestClientException ;
264
+ <T > ResponseEntity <T > postForEntity (URI url , Object request , Class <T > responseType ) throws RestClientException ;
264
265
265
266
// PUT
266
267
@@ -354,7 +355,7 @@ <T> HttpEntity<T> postForEntity(String url, Object request, Class<T> responseTyp
354
355
355
356
/**
356
357
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and
357
- * returns the response as {@link HttpEntity }.
358
+ * returns the response as {@link ResponseEntity }.
358
359
* <p>URI Template variables are expanded using the given URI variables, if any.
359
360
* @param url the URL
360
361
* @param method the HTTP method (GET, POST, etc)
@@ -364,12 +365,12 @@ <T> HttpEntity<T> postForEntity(String url, Object request, Class<T> responseTyp
364
365
* @return the response as entity
365
366
* @since 3.0.2
366
367
*/
367
- <T > HttpEntity <T > exchange (String url , HttpMethod method , HttpEntity <?> requestEntity ,
368
+ <T > ResponseEntity <T > exchange (String url , HttpMethod method , HttpEntity <?> requestEntity ,
368
369
Class <T > responseType , Object ... uriVariables ) throws RestClientException ;
369
370
370
371
/**
371
372
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and
372
- * returns the response as {@link HttpEntity }.
373
+ * returns the response as {@link ResponseEntity }.
373
374
* <p>URI Template variables are expanded using the given URI variables, if any.
374
375
* @param url the URL
375
376
* @param method the HTTP method (GET, POST, etc)
@@ -379,20 +380,20 @@ <T> HttpEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestE
379
380
* @return the response as entity
380
381
* @since 3.0.2
381
382
*/
382
- <T > HttpEntity <T > exchange (String url , HttpMethod method , HttpEntity <?> requestEntity ,
383
+ <T > ResponseEntity <T > exchange (String url , HttpMethod method , HttpEntity <?> requestEntity ,
383
384
Class <T > responseType , Map <String , ?> uriVariables ) throws RestClientException ;
384
385
385
386
/**
386
387
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and
387
- * returns the response as {@link HttpEntity }.
388
+ * returns the response as {@link ResponseEntity }.
388
389
* @param url the URL
389
390
* @param method the HTTP method (GET, POST, etc)
390
391
* @param requestEntity the entity (headers and/or body) to write to the request, may be {@code null}
391
392
* @param responseType the type of the return value
392
393
* @return the response as entity
393
394
* @since 3.0.2
394
395
*/
395
- <T > HttpEntity <T > exchange (URI url , HttpMethod method , HttpEntity <?> requestEntity ,
396
+ <T > ResponseEntity <T > exchange (URI url , HttpMethod method , HttpEntity <?> requestEntity ,
396
397
Class <T > responseType ) throws RestClientException ;
397
398
398
399
// general execution
0 commit comments