Polish contribution

See gh-27586
This commit is contained in:
Sam Brannen 2021-10-21 12:40:10 +02:00
parent b3eb1a2ad7
commit ec3f857bda
1 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,12 +23,12 @@ import org.springframework.util.ObjectUtils;
/**
* Represents an HTTP request or response entity, consisting of headers and body.
*
* <p>Typically used in combination with the {@link org.springframework.web.client.RestTemplate},
* <p>Often used in combination with the {@link org.springframework.web.client.RestTemplate},
* like so:
* <pre class="code">
* HttpHeaders headers = new HttpHeaders();
* headers.setContentType(MediaType.TEXT_PLAIN);
* HttpEntity&lt;String&gt; entity = new HttpEntity&lt;String&gt;("helloWorld", headers);
* HttpEntity&lt;String&gt; entity = new HttpEntity&lt;&gt;("Hello World", headers);
* URI location = template.postForLocation("https://example.com", entity);
* </pre>
* or
@ -39,11 +39,11 @@ import org.springframework.util.ObjectUtils;
* </pre>
* Can also be used in Spring MVC, as a return value from a @Controller method:
* <pre class="code">
* &#64;RequestMapping("/handle")
* &#64;GetMapping("/handle")
* public HttpEntity&lt;String&gt; handle() {
* HttpHeaders responseHeaders = new HttpHeaders();
* responseHeaders.set("MyResponseHeader", "MyValue");
* return new HttpEntity&lt;String&gt;("Hello World", responseHeaders);
* return new HttpEntity&lt;&gt;("Hello World", responseHeaders);
* }
* </pre>
*