Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
af9d8d3a32
commit
c967b100e7
|
@ -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]
|
||||
|
|
|
@ -43,6 +43,8 @@ import org.eclipse.jetty.util.Fields;
|
|||
* <p>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.</p>
|
||||
* <p>{@link Request} objects cannot be reused for other requests, not even for requests
|
||||
* that have identical URI and headers.</p>
|
||||
*
|
||||
* @see Response
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue