Browse Source

Polishing contribution

Closes gh-34230
pull/34398/head
rstoyanchev 11 months ago
parent
commit
5150a9a6ad
  1. 8
      framework-docs/modules/ROOT/pages/integration/rest-clients.adoc
  2. 8
      spring-web/src/test/java/org/springframework/web/service/invoker/RequestHeaderArgumentResolverTests.java

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

@ -938,10 +938,10 @@ method parameters: @@ -938,10 +938,10 @@ method parameters:
| Dynamically set the HTTP method for the request, overriding the annotation's `method` attribute
| `@RequestHeader`
| Add a request header or multiple headers. The argument may be a `Map<String, ?>` or
`MultiValueMap<String, ?>` with multiple headers, a `Collection<?>` of values, or an
individual value. Type conversion is supported for non-String values. This does not override
the annotation's `headers` attribute.
| Add a request header or multiple headers. The argument may be a single value,
a `Collection<?>` of values, `Map<String, ?>`,`MultiValueMap<String, ?>`.
Type conversion is supported for non-String values. Header values are added and
do not override already added header values.
| `@PathVariable`
| Add a variable for expand a placeholder in the request URL. The argument may be a

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

@ -53,8 +53,8 @@ class RequestHeaderArgumentResolverTests { @@ -53,8 +53,8 @@ class RequestHeaderArgumentResolverTests {
@Test
void doesNotOverrideAnnotationHeaders() {
this.service.executeWithAnnotationHeaders("test");
assertRequestHeaders("id", "default", "test");
this.service.executeWithAnnotationHeaders("2");
assertRequestHeaders("myHeader", "1", "2");
}
private void assertRequestHeaders(String key, String... values) {
@ -73,8 +73,8 @@ class RequestHeaderArgumentResolverTests { @@ -73,8 +73,8 @@ class RequestHeaderArgumentResolverTests {
@GetExchange
void execute(@RequestHeader String id);
@HttpExchange(method = "GET", headers = "id=default")
void executeWithAnnotationHeaders(@RequestHeader String id);
@HttpExchange(method = "GET", headers = "myHeader=1")
void executeWithAnnotationHeaders(@RequestHeader String myHeader);
}

Loading…
Cancel
Save