|
|
|
@ -33,14 +33,14 @@ import org.springframework.util.ObjectUtils; |
|
|
|
|
* {@link org.springframework.web.client.RestTemplate#exchange(RequestEntity, Class) exchange()}: |
|
|
|
|
* <pre class="code"> |
|
|
|
|
* MyRequest body = ... |
|
|
|
|
* RequestEntity<MyRequest> request = RequestEntity.post(new URI("http://example.com/bar").accept(MediaType.APPLICATION_JSON).body(body);
|
|
|
|
|
* RequestEntity<MyRequest> request = RequestEntity.post(new URI("http://example.com/bar")).accept(MediaType.APPLICATION_JSON).body(body);
|
|
|
|
|
* ResponseEntity<MyResponse> response = template.exchange(request, MyResponse.class); |
|
|
|
|
* </pre> |
|
|
|
|
* |
|
|
|
|
* <p>If you would like to provide a URI template with variables, consider using |
|
|
|
|
* {@link org.springframework.web.util.UriTemplate}: |
|
|
|
|
* <pre class="code"> |
|
|
|
|
* URI uri = new UriTemplate("http://example.com/{foo}"").expand("bar");
|
|
|
|
|
* URI uri = new UriTemplate("http://example.com/{foo}").expand("bar");
|
|
|
|
|
* RequestEntity<MyRequest> request = RequestEntity.post(uri).accept(MediaType.APPLICATION_JSON).body(body); |
|
|
|
|
* </pre> |
|
|
|
|
* |
|
|
|
|