|
|
|
|
@ -468,7 +468,7 @@ public interface RestOperations {
@@ -468,7 +468,7 @@ public interface RestOperations {
|
|
|
|
|
* with the static builder methods on {@code RequestEntity}, for instance: |
|
|
|
|
* <pre class="code"> |
|
|
|
|
* MyRequest body = ... |
|
|
|
|
* RequestEntity request = RequestEntity.post(new URI("http://example.com/foo").accept(MediaType.APPLICATION_JSON).body(body);
|
|
|
|
|
* RequestEntity request = RequestEntity.post(new URI("http://example.com/foo")).accept(MediaType.APPLICATION_JSON).body(body);
|
|
|
|
|
* ResponseEntity<MyResponse> response = template.exchange(request, MyResponse.class); |
|
|
|
|
* </pre> |
|
|
|
|
* @param requestEntity the entity to write to the request |
|
|
|
|
@ -484,7 +484,7 @@ public interface RestOperations {
@@ -484,7 +484,7 @@ public interface RestOperations {
|
|
|
|
|
* {@link ParameterizedTypeReference} is used to pass generic type information: |
|
|
|
|
* <pre class="code"> |
|
|
|
|
* MyRequest body = ... |
|
|
|
|
* RequestEntity request = RequestEntity.post(new URI("http://example.com/foo").accept(MediaType.APPLICATION_JSON).body(body);
|
|
|
|
|
* RequestEntity request = RequestEntity.post(new URI("http://example.com/foo")).accept(MediaType.APPLICATION_JSON).body(body);
|
|
|
|
|
* ParameterizedTypeReference<List<MyResponse>> myBean = new ParameterizedTypeReference<List<MyResponse>>() {}; |
|
|
|
|
* ResponseEntity<List<MyResponse>> response = template.exchange(request, myBean); |
|
|
|
|
* </pre> |
|
|
|
|
|