diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java index 3e28e8e759e..542d5fb53fb 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java @@ -151,10 +151,15 @@ public interface Request * @param name the name of the header * @param value the value of the header * @return this request object + * @see #header(HttpHeader, String) */ Request header(String name, String value); /** + *

Adds the given {@code value} to the specified {@code header}.

+ *

Multiple calls with the same parameters will add multiple values; + * use the value {@code null} to remove the header completely.

+ * * @param header the header name * @param value the value of the header * @return this request object diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java index 93c98f61a40..79ab25a4f81 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java @@ -847,6 +847,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest response = client.newRequest("localhost", connector.getLocalPort()) .scheme(scheme) + .header(HttpHeader.USER_AGENT, null) .header(HttpHeader.USER_AGENT, userAgent) .timeout(5, TimeUnit.SECONDS) .send();