In old 4.0 library you would simply do:

```
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpParams params = httpClient.getParams();
HttpConnectionParams.setConnectionTimeout(httpParams, connectionTimeoutMillis);
HttpConnectionParams.setSoTimeout(httpParams, socketTimeoutMillis);

```

but now DefaultHttpClient is deprecated and in order to create an httpclient you have to do:

```
HttpClients.createDefault();

```

this is nice but doesn't allow me to set a timeout for requests. So, is there a workaround/way without returning to deprecated class?