首页 > 代码库 > 如何刷新或清除HttpURLConnection的连接缓存

如何刷新或清除HttpURLConnection的连接缓存

项目需要定期与远程服务器同步数据,基于如下代码: URL url = new URL("http://test.com/sales/info"); connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoOutput(true); connection.setUseCaches(false);

 

如何刷新或清除HttpURLConnection的连接缓存