Hi,
I'm stuck configuring Restlet for my client-side code. I'm using Restlet 2 and HttpClient 4. I added the extension jar and the HttpClient jars to the build path and it seems to work.
However, I don't know how to configure it in detail. I don't create any client manually, instead I use ClientResource
s for interactions, which is the only part where I use Restlet directly. The concrete instantiation of clients seems to be hidden in the framework implementation. I found some hints how I might configure clients, but they all were written for Restlet 1.x.
In detail, I want to configure the following parts:
- Change the User Agent for client requests.
clientResource.getClientInfo().setAgent(…)
does not work. - Increase the number of parallel connections per host.
- Enable persistent connections and pooling per host. Obviously, Restlet so far creates a new connection per
ClientResource
, which is not really efficient.
Of course, I already had a look at HttpClientHelper, but I don't know where and how to add this. Already searched the documentation for that, but no hits.
Thanks for help!