timboudreau/netty-http-client

HttpClient.builder().build()

Closed this issue · 1 comments

Hi,

I have a query regarding the usage of netty-http-client. I am using this client for making multiple requests. I am doing the following

HttpClient client = HttpClient.builder().build();
client.get().setURL("http://www.google.com").execute(new ResponseHandler(String.class) {

  protected void receive ( HttpResponseStatus status, HttpHeaders headers, String response ) {
    // handle response  
});

Suppose I have to make 1000 requests. Do I need to do the following multiple time?
HttpClient client = HttpClient.builder().build();

Or use it as a singleton object and use it to make all the requests?

Thanks & Regards,
Tanima

You can and should reuse the HttpClient.

On Mon, Mar 16, 2015 at 8:18 AM, tanimasaini notifications@github.com
wrote:

Hi,

I have a query regarding the usage of netty-http-client. I am using this
client for making multiple requests. I am doing the following

HttpClient client = HttpClient.builder().build();
client.get().setURL("http://www.google.com").execute(new
ResponseHandler(String.class) {

protected void receive ( HttpResponseStatus status, HttpHeaders headers, String response ) {
// handle response
});

Suppose I have to make 1000 requests. Do I need to do the following
multiple time?
HttpClient client = HttpClient.builder().build();

Or use it as a singleton object and use it to make all the requests?

Thanks & Regards,
Tanima


Reply to this email directly or view it on GitHub
#4.

http://timboudreau.com