|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2020 the original author or authors. |
| 2 | + * Copyright 2002-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
23 | 23 | /**
|
24 | 24 | * Represents an HTTP request or response entity, consisting of headers and body.
|
25 | 25 | *
|
26 |
| - * <p>Typically used in combination with the {@link org.springframework.web.client.RestTemplate}, |
| 26 | + * <p>Often used in combination with the {@link org.springframework.web.client.RestTemplate}, |
27 | 27 | * like so:
|
28 | 28 | * <pre class="code">
|
29 | 29 | * HttpHeaders headers = new HttpHeaders();
|
30 | 30 | * headers.setContentType(MediaType.TEXT_PLAIN);
|
31 |
| - * HttpEntity<String> entity = new HttpEntity<String>("helloWorld", headers); |
| 31 | + * HttpEntity<String> entity = new HttpEntity<>("Hello World", headers); |
32 | 32 | * URI location = template.postForLocation("https://example.com", entity);
|
33 | 33 | * </pre>
|
34 | 34 | * or
|
|
39 | 39 | * </pre>
|
40 | 40 | * Can also be used in Spring MVC, as a return value from a @Controller method:
|
41 | 41 | * <pre class="code">
|
42 |
| - * @RequestMapping("/handle") |
| 42 | + * @GetMapping("/handle") |
43 | 43 | * public HttpEntity<String> handle() {
|
44 | 44 | * HttpHeaders responseHeaders = new HttpHeaders();
|
45 | 45 | * responseHeaders.set("MyResponseHeader", "MyValue");
|
46 |
| - * return new HttpEntity<String>("Hello World", responseHeaders); |
| 46 | + * return new HttpEntity<>("Hello World", responseHeaders); |
47 | 47 | * }
|
48 | 48 | * </pre>
|
49 | 49 | *
|
|
0 commit comments