在第一次请求时,它会访问互联网并检索数据。当我再次尝试时,它只给我输入流中已有的数据。如何清除缓存数据,以便每次都执行新请求?
这是我的代码:
InputStreamReader in = null;
in = new InputStreamReader(url.openStream());
response = readFully(in);
url.openStream().close();
最佳答案
每次都重新创建 URL 对象。
关于java - Internet 请求第一次有效,但后续请求无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10973104/