0

I have imported httpclient jar files, but this command cannot be resolved in eclipse or in selenium. But when click in error, it shows option to import but it doesn't work.

final HttpParams httpParams = new BasicHttpParams(); 
HttpConnectionParams.setConnectionTimeout(httpParams, 30000); 
HttpConnectionParams.setSoTimeout(httpParams, 30000); 
HttpClient client = new DefaultHttpClient(); 
HttpPost post = new HttpPost(url); 
post.setHeader("Content-Type", "application/json"); 
post.setEntity(new StringEntity(input, HTTP.UTF_8)); 
HttpResponse response = client.execute(post); 
client.getConnectionManager().closeExpiredConnections();
Würgspaß
  • 4,660
  • 2
  • 25
  • 41
  • Hi @sreekutty, welcome to Stack Overflow. Can you please provide a formatted code sample to provide a [Minimal, Complete and Verifiable example](https://stackoverflow.com/help/mcve)? – Phil Sheard Mar 12 '18 at 09:25
  • final HttpParams httpParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParams, 30000); HttpConnectionParams.setSoTimeout(httpParams, 30000); HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(url); post.setHeader("Content-Type", "application/json"); post.setEntity(new StringEntity(input, HTTP.UTF_8)); HttpResponse response = client.execute(post); client.getConnectionManager().closeExpiredConnections(); – sreekutty Mar 12 '18 at 09:36

0 Answers0