【发布时间】:2016-02-18 06:55:12
【问题描述】:
我正在使用 Web HDFS REST 客户端,我可以上传 .xml 和 .q 文件。
有用的代码部分 -
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPut httpPut = new HttpPut(urlString);
httpPut.setHeader("Accept", "application/xml");
httpPut.setHeader("Content-type", "application/xml");
CloseableHttpResponse response = httpclient.execute(httpPut);
我在上传 .jar 时遇到问题。上传的文件已损坏。
上传 jars 需要在“Content-type”和“Accept”中设置什么?
【问题讨论】:
标签: hadoop httpclient apache-httpclient-4.x webhdfs