我已经导入了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();