最佳答案
我知道过去有一种方法可以使用 Apache Commons 获得它,这里有文档说明:
Http://hc.apache.org/httpclient-legacy/apidocs/org/apache/commons/httpclient/httpmethod.html
举个例子:
Http://www.kodejava.org/examples/416.html
但我相信这是不可取的。
有没有其他方法可以在 Java 中发出 http get 请求,并以字符串而不是流的形式获取响应主体?