Fixed code examples

Issue: SPR-13666
master
Juergen Hoeller 9 years ago
parent 2bf8c0bc42
commit 71a7b5d086
  1. 4
      spring-web/src/main/java/org/springframework/http/RequestEntity.java

@ -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&lt;MyRequest&gt; request = RequestEntity.post(new URI(&quot;http://example.com/bar&quot;).accept(MediaType.APPLICATION_JSON).body(body);
* RequestEntity&lt;MyRequest&gt; request = RequestEntity.post(new URI(&quot;http://example.com/bar&quot;)).accept(MediaType.APPLICATION_JSON).body(body);
* ResponseEntity&lt;MyResponse&gt; 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(&quot;http://example.com/{foo}&quot;").expand(&quot;bar&quot;);
* URI uri = new UriTemplate(&quot;http://example.com/{foo}&quot;).expand(&quot;bar&quot;);
* RequestEntity&lt;MyRequest&gt; request = RequestEntity.post(uri).accept(MediaType.APPLICATION_JSON).body(body);
* </pre>
*

Loading…
Cancel
Save