I have a string array a[] that contains several urls that I want to pass into my HttpGet code below
for (int i = 0; i < size; i++);{
try (CloseableHttpClient httpclient = HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build()){
HttpGet httpget = new HttpGet(a[i]);
/*WRITE TO FILE*/
/*try (CloseableHttpResponse response = httpclient.execute(new HttpGet(a[i]))){
HttpEntity entity = response.getEntity();
if (entity != null) {
try (FileOutputStream outstream = new FileOutputStream(AgentRequirements)) {
entity.writeTo(outstream);
}
}
}*/
/*SHOW EXECUTION*/
System.out.println("Executing request " + httpget.getRequestLine());
try (CloseableHttpResponse response = httpclient.execute(httpget)) {
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
System.out.println(EntityUtils.toString(response.getEntity()));
}
}
}
I have a failed build because it says that system cannot find symbol 'i'. Can anyone help please?