How to set an Apache HttpClient timeout value

Category: 

How to set a timeout on an Apache HttpClient:

HttpClient client = new DefaultHttpClient();
client.getParams().setParameter("http.socket.timeout", new Integer(10*1000));

I like to make my code easier to read, so I use the "10*1000" there to make it easier to read that I want a ten-second timeout.

Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 

Post new comment

The content of this field is kept private and will not be shown publicly.