diff --git a/documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-api.adoc b/documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-api.adoc index 6a2e2412dfc..459b666b866 100644 --- a/documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-api.adoc +++ b/documentation/jetty-documentation/src/main/asciidoc/programming-guide/client/http/client-http-api.adoc @@ -48,6 +48,9 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPCli You first create a request object using `httpClient.newRequest(...)`, and then you customize it using the fluent API style (that is, a chained invocation of methods on the request object). When the request object is customized, you call `request.send()` that produces the `ContentResponse` when the request/response conversation is complete. +IMPORTANT: The `Request` object, despite being mutable, cannot be reused for other requests. +This is true also when trying to send two or more identical requests: you have to create two or more `Request` objects. + Simple `POST` requests also have a shortcut method: [source,java,indent=0] 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 f3457897ee9..e2919eb86b8 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 @@ -43,6 +43,8 @@ import org.eclipse.jetty.util.Fields; *
You can create {@link Request} objects via {@link HttpClient#newRequest(String)} and * you can send them using either {@link #send()} for a blocking semantic, or * {@link #send(Response.CompleteListener)} for an asynchronous semantic.
+ *{@link Request} objects cannot be reused for other requests, not even for requests + * that have identical URI and headers.
* * @see Response */