读书人

http 请求不用响应内容

发布时间: 2012-12-24 10:43:14 作者: rapoo

http 请求不要响应内容
URL a = new URL(args[0]);
URLConnection urlc = a.openConnection();
HttpURLConnection httpc = (HttpURLConnection)urlc;
// only interested in the length of the resource
httpc.setRequestMethod("HEAD");
int len = httpc.getContentLength();

读书人网 >编程

热点推荐