我已导入httpclient
jar文件,但此命令无法在eclipse或selenium中解析。但是当点击错误时,它会显示导入选项,但它不起作用。
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();