更新时间:2023-02-17 15:44:15
要回答我自己的问题:要释放连接(以及与请求关联的任何其他资源),您必须关闭 HttpEntity 返回的 InputStream:
To answer my own question: to release the connection (and any other resources associated with the request) you must close the InputStream returned by the HttpEntity:
InputStream is = entity.getContent();
.... process the input stream ....
is.close(); // releases all resources
来自 文档