有没有更好的方法同时发送数千个http GET请求?我的代码一个接一个地发送请求。看了其他的答案,但无法弄清楚。谢谢。
for (int j=0; j<4; j++)
{
DefaultHttpClient httpclient = new DefaultHttpClient();
CookieStore cookieStore = httpclient.getCookieStore();
HttpGet httpget = new HttpGet("");
try {
HttpResponse response = httpclient.execute(httpget);
List<Cookie> cookies = cookieStore.getCookies();
} catch (Exception e) {}
httpclient.getConnectionManager().shutdown();
}
答案 0 :(得分:3)