草庐IT

Closablehttpresponse

全部标签

为什么Apache Closablehttpresponse不会在关闭时消耗该实体?

看着快速入门指南它给出以下代码示例:CloseableHttpClienthttpclient=HttpClients.createDefault();HttpGethttpGet=newHttpGet("http://targethost/homepage");CloseableHttpResponseresponse1=httpclient.execute(httpGet);//TheunderlyingHTTPconnectionisstillheldbytheresponseobject//toallowtheresponsecontenttobestreameddirectlyfro