从List Feed中获取文档ID后,我尝试使用google协议下载文档。
代码:
HttpRequest request = transport.buildGetRequest();
request.url = DocsUrl.forDownloadingFile(id, "txt");
System.out.println("Request URL = "+request.url);
try {
HttpResponse response = request.execute();
System.out.println("Code = "+response.statusCode);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
但是我找到了402 Not Found。
访问文档的网址是
Request URL = https://docs.google.com/feeds/download/documents/Export%3FdocID=1ckJuekHM9I6NeOhcTagqxeW69sHC9IQkOyuF__eNUxk&exportFormat=txt
我在某个地方出错了吗?
谢谢, 萨纳。