Hit a url n times parallely

WPG

New Member
I want to hit a url n times parallelly. I googled for it and found this url. I tried to change according to my requirement(hit a url n times and see the response of each one),but not succeed.I added the following code for exacuting a request and getting the response in Task class constructor in above link,but this only work searially. \[code\]DefaultHttpClient client = new DefaultHttpClient(); HttpPost method = new HttpPost(aURL); try { HttpResponse httpResponse=client.execute(method); StringBuffer buffer = new StringBuffer(); BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent())); String dataLine = null; while((dataLine = reader.readLine()) != null){ buffer.append(dataLine); } String responseMsg = buffer.toString(); System.out.println(responseMsg); \[/code\]any help is appriciated.
 
Top