I'm trying to implement async http in java. Here is the important
part of the code:
for (String urlString : urls)
{
// TODO: try and get rid of these two heap allocations
url = new URL(urlString);
request = new HTTPRequest(url);
request.addHeader(userAgentHeader);
request.addHeader(authorizationHeader);
request.addHeader(acceptEncodingHeader);
request.addHeader(acceptCharsetHeader);
responses.add(URLFetchServiceFactory.getURLFetchService().fetchAsync(reques t));
apiCallsMade++;
}
for (Future<HTTPResponse> futureResponse : responses)
{
parseResponse(new String(futureResponse.get().getContent()));
}
I keep getting this error:
com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'urlfetch' or call 'Fetch()'
was not found.
I looked around for any jars that were missing from
the classpath but didn't see anything missing. Do you know which jar
that code is in? I googled the error and also searched through this
group but found nothing.
Thanks,
David
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…