+ // todo use HttpClient 4.3 or later and class RequestConfig
+ HttpParams params = new BasicHttpParams();
+ params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION,
+ HttpVersion.HTTP_1_1);
+ if (connectionTimeoutMs > 0)
+ {
+ HttpConnectionParams.setConnectionTimeout(params,
+ connectionTimeoutMs);
+ }
+ if (readTimeoutMs > 0)
+ {
+ HttpConnectionParams.setSoTimeout(params, readTimeoutMs);
+ }
+ HttpClient httpclient = new DefaultHttpClient(params);