Polishing contribution
Closes gh-34230
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
@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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user