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

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

 

posted @ 2016-10-08 23:54  shiningrise  阅读(629)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css