协议版本

URL url = new URL("http://www.mydomain.com/down.zip";); 
HttpURLConnection httpConnection=(HttpURLConnection) url.openConnection(); 
    //设置断点续传的开始位置 
    httpConnection.setRequestProperty("RANGE","bytes=10000"); 
    //设置请求信息
    httpConnection.setRequestProperty("GET","/down.zip HTTP/1.1");
    //设置接受信息
httpConnection.setRequestProperty("Accept","image/gif,image/x-xbitmap,application/
msword,*/*");
    //设置连接信息
    httpConnection.setRequestProperty("Connection","Keep-Alive"); 
    //获得输入流 
InputStream input = httpConnection.getInputStream();

你可能感兴趣的:(协议)