此HttpRequest适用于Google云端硬盘。
当我解析响应头时,content-length为null。当我使用getContentLength()方法(见下文)时,以及当我打印出响应header.toString时,情况也是如此 - 该值不在那里。
我不熟悉httpRequests,我是否要求将内容长度包含在回复中?
public static HttpResponse getFile_contents(String downloadurl, Drive drive) throws IOException{
HttpRequest request = drive.getRequestFactory().
buildGetRequest(new GenericUrl(downloadurl));
HttpResponse response = request.execute();
Long length = response.getHeaders().getContentLength();
//Length is null...
return response;
}