Closed GoogleCodeExporter closed 9 years ago
Yes a new client is created for each request. It would be nice to make this
configurable. Please help out!
Original comment by johan.ha...@gmail.com
on 14 May 2013 at 6:57
The underlying http client is reinstantiated for each request. But it's now
possible to configure this by providing your own http client factory, for
example:
given().
config(newConfig().httpClient(HttpClientConfig.httpClientConfig().httpClientFactory(new HttpClientConfig.HttpClientFactory() {
@Override
public AbstractHttpClient createHttpClient() throws Exception {
return new SystemDefaultHttpClient();
}
}))).
Instead of returning a new "SystemDefaultHttpClient" you can make sure that the
same instance is reused. Please try this out by depending on version
1.8.2-SNAPSHOT after having added the following maven repo:
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots />
</repository>
</repositories>
Original comment by johan.ha...@gmail.com
on 13 Nov 2013 at 7:06
Original comment by johan.ha...@gmail.com
on 19 Nov 2013 at 6:42
Original issue reported on code.google.com by
everf...@gmail.com
on 11 May 2013 at 6:25