Skip to content

Commit 5150a9a

Browse files
committed
Polishing contribution
Closes gh-34230
1 parent a8c5885 commit 5150a9a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

framework-docs/modules/ROOT/pages/integration/rest-clients.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,10 @@ method parameters:
938938
| Dynamically set the HTTP method for the request, overriding the annotation's `method` attribute
939939

940940
| `@RequestHeader`
941-
| Add a request header or multiple headers. The argument may be a `Map<String, ?>` or
942-
`MultiValueMap<String, ?>` with multiple headers, a `Collection<?>` of values, or an
943-
individual value. Type conversion is supported for non-String values. This does not override
944-
the annotation's `headers` attribute.
941+
| Add a request header or multiple headers. The argument may be a single value,
942+
a `Collection<?>` of values, `Map<String, ?>`,`MultiValueMap<String, ?>`.
943+
Type conversion is supported for non-String values. Header values are added and
944+
do not override already added header values.
945945

946946
| `@PathVariable`
947947
| Add a variable for expand a placeholder in the request URL. The argument may be a

spring-web/src/test/java/org/springframework/web/service/invoker/RequestHeaderArgumentResolverTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ void header() {
5353

5454
@Test
5555
void doesNotOverrideAnnotationHeaders() {
56-
this.service.executeWithAnnotationHeaders("test");
57-
assertRequestHeaders("id", "default", "test");
56+
this.service.executeWithAnnotationHeaders("2");
57+
assertRequestHeaders("myHeader", "1", "2");
5858
}
5959

6060
private void assertRequestHeaders(String key, String... values) {
@@ -73,8 +73,8 @@ private interface Service {
7373
@GetExchange
7474
void execute(@RequestHeader String id);
7575

76-
@HttpExchange(method = "GET", headers = "id=default")
77-
void executeWithAnnotationHeaders(@RequestHeader String id);
76+
@HttpExchange(method = "GET", headers = "myHeader=1")
77+
void executeWithAnnotationHeaders(@RequestHeader String myHeader);
7878

7979
}
8080

0 commit comments

Comments
 (0)