In my code I use some Http Get request to download some files as a stream. I use the following code:
public String getClassName(String url) throws ClientProtocolException, IOException {
HttpResponse response = sendGetRequestJsonText(url);
Header[] all = response.getAllHeaders();
for (Header h : all) {
System.out.println(h.getName() + ": " + h.getValue());
}
Header[] headers = response.getHeaders("Content-Disposition");
InputStreamParser.convertStreamToString(response.getEntity().getContent());
String result = "";
for (Header header : headers) {
result = header.getValue();
}
return result.substring(result.indexOf(" ") + " ".length(), result.length()).trim();
}
但这下载了答复的全部内容。 我只想找不到内容的负责人。 “欧洲复兴开发银行”的请求似乎不可行,因为当时我获得的地位为501,但没有得到执行。 我如何能够这样做?